Use the output of a command as input of the next command

Posted by r2b2 on Stack Overflow See other posts from Stack Overflow or by r2b2
Published on 2010-04-22T09:19:28Z Indexed on 2010/04/22 9:33 UTC
Read the original article Hit count: 233

Filed under:
|

so i call this php script from the command line :

/usr/bin/php /var/www/bims/index.php "projects/output"

and it's output is :

file1 file2 file3

What I would like to do is get this output and feed to the "rm" command but i think im not doing it right :

/usr/bin/php /var/www/bims/index.php "projects/output" | rm 

My goal is to delete whatever file names the php script outputs. What should be the proper way to do this?

Thanks!

© Stack Overflow or respective owner

Related posts about linux

Related posts about bash