LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 04-12-2005, 11:19 PM   #1
neo_in_matrix
Member
 
Registered: Sep 2003
Posts: 52

Rep: Reputation: 15
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.
 
Old 04-12-2005, 11:24 PM   #2
scuzzman
Senior Member
 
Registered: May 2004
Location: Hilliard, Ohio, USA
Distribution: Slackware, Kubuntu
Posts: 1,851

Rep: Reputation: 47
Try this:
Code:
program_name | xargs rm
 
Old 04-12-2005, 11:24 PM   #3
Harmaa Kettu
Member
 
Registered: Apr 2005
Location: Finland
Posts: 196

Rep: Reputation: 30
Code:
for file in `myprog`; do rm $file; done
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Mailing List program with click tracking ?? ALInux Linux - Software 1 12-30-2006 12:42 PM
concepts a linked list program in c ssg14j Programming 4 08-19-2005 10:10 AM
link list reversl program vijeesh_ep Programming 3 02-27-2005 12:17 AM
Help!How can I get the file name list in C program? wuzhong Programming 6 09-22-2004 11:56 AM
The program returned an error code (3) Omega Linux - Software 1 05-04-2003 09:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration