LINUX.ORG.RU

История изменений

Исправление dexpl, (текущая версия) :

--exclude-dir={dir1, dir2}

Раскрытие фигурных скобок — фича шелла, от версии grep не зависит; пробел после запятой в такой конструкции не нужен и вреден.

BTW, УМВР:

┌[ dexpl@shellvm:/tmp/tmp.VwdCa35MtD 14:56:26 ]
└► grep --version ; cat /etc/centos-release
grep (GNU grep) 2.20
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
CentOS Linux release 7.5.1804 (Core) 
┌[ dexpl@shellvm:/tmp/tmp.VwdCa35MtD 14:56:08 ]
└► mkdir {1..3}
┌[ dexpl@shellvm:/tmp/tmp.VwdCa35MtD 14:56:13 ]
└► echo test | tee -a {1..3}/test
test
┌[ dexpl@shellvm:/tmp/tmp.VwdCa35MtD 14:56:20 ]
└► grep -R --exclude-dir={1,2} -e test .
./3/test:test

Исходная версия dexpl, :

--exclude-dir={dir1, dir2}

Раскрытие фигурных скобок — фича шелла, от версии и пробел после запятой в такой конструкции не нужен и вреден.

BTW, УМВР:

┌[ dexpl@shellvm:/tmp/tmp.VwdCa35MtD 14:56:26 ]
└► grep --version ; cat /etc/centos-release
grep (GNU grep) 2.20
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Mike Haertel and others, see <http://git.sv.gnu.org/cgit/grep.git/tree/AUTHORS>.
CentOS Linux release 7.5.1804 (Core) 
┌[ dexpl@shellvm:/tmp/tmp.VwdCa35MtD 14:56:08 ]
└► mkdir {1..3}
┌[ dexpl@shellvm:/tmp/tmp.VwdCa35MtD 14:56:13 ]
└► echo test | tee -a {1..3}/test
test
┌[ dexpl@shellvm:/tmp/tmp.VwdCa35MtD 14:56:20 ]
└► grep -R --exclude-dir={1,2} -e test .
./3/test:test