(I have to say, this seems to be a rather specific task that does not benefit much from scripting. But all learning is good
and I hope the following information is useful for you.)
Use google to find an introduction to bash, e.g.
http://www.faqs.org/docs/Linux-HOWTO/Bash-Prog-Intro-HOWTO.html, and to find manual pages, e.g.
http://www.hmug.org/man/1/rm.php. You can also read man pages in Terminal, type:
If we assume you have made a list of the files and folders, then it is enough to issue the bash remove command, "rm":
files.lst
Code:
/Users/me/Applications/appl
/Users/me/Library/appl/appl.plist
/path/to/something
Open Terminal, and type:
Code:
cat files.lst | while read line ; do rm -rf "$line" ; done
If you prefer to see this as a bash script, then:
remove_files.sh
Code:
#!/bin/bash
while read line ; do rm -rf "$line" ; done
Notice how the "
cat files.lst" is missing from the script: this was done to make the script more general (you can use the script with other lists of files). Furthermore, I used the while loop so that filenames with spaces in them would be handled correctly. To run this from Terminal, type:
Code:
cat files.lst | ./remove_files.sh