Ano-Tech Computers
Enter keyword:

bash: How to use the 'for' command
Problem:
How to perform a set of commands with arguments taken from a file or a piped list
 
Solution:
"for a in `cat filelist`; do rm -Rf $a; done"

Remember to use backticks, not ordinary single quote marks
 
Discuss this solution
Did this article solve your problem? Yes No Did not apply

We welcome anyone who is willing to contribute to this public knowledge base, contact siteadmin@atc.no if you have information you would like to share. The idea is not to replace the commercial support sites, but to publish those hard-to-find solutions you've found yourself looking for over and over again.

Show all articles