Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^4: UNIX command - remove 0 byte file

by mhacker (Sexton)
on Sep 23, 2005 at 12:55 UTC ( #494510=note: print w/ replies, xml ) Need Help??


in reply to Re^3: UNIX command - remove 0 byte file
in thread UNIX command - remove 0 byte file

Actually, xargs is supposed to handle that. It will break the command line when it gets too long (1024 words, I think) and run the command again.

But the most annoying thing with xargs is that it doesn't handle spaces or other special characters well:

server:~> ls a file server:~> ls | xargs rm a: No such file or directory file: No such file or directory
You're forced to do tricks with sed (or perl -e) to get this to work.


Comment on Re^4: UNIX command - remove 0 byte file
Download Code
Replies are listed 'Best First'.
Re^5: UNIX command - remove 0 byte file
by YuckFoo (Abbot) on Sep 23, 2005 at 17:28 UTC
    GNU xargs offers -i to deal with spaces.

    ls | xargs -i ls
    XargFoo

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://494510]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2015-07-31 01:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (274 votes), past polls