スペースを含むファイルを含むディレクトリ
$ ls .
'File A' 'File B' 'File C'
$ walk .
.
./File A
./File B
./File C
ls は各スペースを新しいファイルとして解釈します。
$ ls -ld $(walk .)
ls: cannot access './File': No such file or directory
ls: cannot access 'A': No such file or directory
ls: cannot access './File': No such file or directory
ls: cannot access 'B': No such file or directory
ls: cannot access './File': No such file or directory
ls: cannot access 'C': No such file or directory
drwxr-xr-x 1 nathan users 36 Apr 27 16:56 .
[ble: exit 2]
行の周りに引用符を入れる
$ walk . | sed 's/.*/"&"/'
"."
"./File A"
"./File B"
"./File C"
動作しません
$ ls -ld $(walk . | sed 's/.*/"&"/')
ls: cannot access '"."': No such file or directory
ls: cannot access '"./File': No such file or directory
ls: cannot access 'A"': No such file or directory
ls: cannot access '"./File': No such file or directory
ls: cannot access 'B"': No such file or directory
ls: cannot access '"./File': No such file or directory
ls: cannot access 'C"': No such file or directory
[ble: exit 2]