How to rm a list of files returned from another program?
I have a perl script that output file names like this:
/path/file1 /path/file2 /path/file3 Now I want to rm the list of files output by this script. How to do that? I tried myprog|rm, but it does not work. |
Try this:
Code:
program_name | xargs rm |
Code:
for file in `myprog`; do rm $file; done |
All times are GMT -5. The time now is 10:41 PM. |