How can I use -0 option to xargs when specifying the input manually?

I have

~/bashpractice$ ls
dir3 dir1   

I get

~/bashpractice$ xargs ls -l 
dir1 dir3
dir1:
total 0
-rw-r--r-- 1 abc abc 0 2011-05-23 10:19 file1
-rw-r--r-- 1 abc abc 0 2011-05-23 10:19 file2

dir3:
total 0
-rw-r--r-- 1 abc abc 0 2011-05-23 10:20 file1
-rw-r--r-- 1 abc abc 0 2011-05-23 10:20 file2

But I get an error when I do

~/bashpractice$ xargs -0 ls -l
dir1 dir3
ls: cannot access dir1 dir3
: No such file or directory

abc@us-sjc1-922l:~/bashpractice$ xargs -0 ls -l
dir1
dir3 
ls: cannot access dir1
dir3
: No such file or directory

How to get a listing when specifying -0 option to xargs ?

6
задан Paŭlo Ebermann 20 August 2011 в 19:51
поделиться