NevemTeve Creative Commons License 2007.02.05 0 0 149
K: Igaz, hogy a szóközt tartalmazó filenevek máshol is okozhatnak gondot?
V: Íme egy példa:
$ cd /tmp
$ mkdir proba
$ cd proba
$ touch a "b b" "c c c"
$ find . -print | xargs echo
. ./a ./b b ./c c c

K: Ez így tökéletes, nem?
V: Hát nem... próbáld ki így:
$ find . -print | xargs ls -ld
ls: ./b: No such file or directory
ls: b: No such file or directory
ls: ./c: No such file or directory
ls: c: No such file or directory
ls: c: No such file or directory
drwxr-xr-x 2 teve users 120 Feb 5 13:56 .
-rw-r--r-- 1 teve users 0 Feb 5 11:23 ./a

K: Ezt a kavarodást a file-nevekben lévő szóközök okozták?
V: Igen. Most próbáld ki így:
$ find . -print0 | xargs -0 ls -ld
drwxr-xr-x 2 zsiga users 120 Feb 5 13:56 .
-rw-r--r-- 1 teve users 0 Feb 5 11:23 ./a
-rw-r--r-- 1 teve users 0 Feb 5 11:23 ./b b
-rw-r--r-- 1 teve users 0 Feb 5 11:23 ./c c c
Előzmény: NevemTeve (125)