in reply to how to write a perl one liner?
How about a bash one liner?
Or if p4 can take multiple args file names,for f in `cat deletefiles.txt` ; do p4 delete "$f" ; done
p4 delete `cat deletefiles.txt`
Note: Both assume the file names have no shell characters in them (e.g. spaces, "*"). I'm sure that restriction can be eliminated pretty simply, though. Anyone care to enlighten?
Update: And the answer is:
xargs -d \n p4 delete < deletefiles.txt
I think it needs a -n 1 in there if p4 delete can only take one file name at a time.
See xargs.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: how to write a perl one liner?
by ambrus (Abbot) on Mar 08, 2011 at 14:02 UTC | |
by ikegami (Patriarch) on Mar 08, 2011 at 17:45 UTC | |
by ambrus (Abbot) on Mar 08, 2011 at 19:05 UTC | |
by ikegami (Patriarch) on Mar 08, 2011 at 20:17 UTC | |
|
Re^2: how to write a perl one liner?
by perl_mystery (Beadle) on Mar 08, 2011 at 08:43 UTC | |
by ikegami (Patriarch) on Mar 08, 2011 at 08:48 UTC |