Tiny Core Linux

Tiny Core Extensions => TCE Talk => Topic started by: PingPing on June 05, 2009, 04:31:43 AM

Title: bash script help needed
Post by: PingPing on June 05, 2009, 04:31:43 AM
I'm new bash scripting and need some advice.
I'm working on a remaster script that downloads a tce, extracts it and then consults a file ('remove_file_list') and removes files listed in that list.
The current script snippet is:
Code: [Select]
for FILE in `cat ../remove_file_list`
do
        rm -rf $FILE
done
I now want to amend the script so that I can insert comment lines (ie. all beginning with #) in remove_file_list and these lines will be ignored by the above script.

How do I do this?
Title: Re: bash script help needed
Post by: curaga on June 05, 2009, 05:44:19 AM
`cat ../remove_file_list | grep -v '^#'`
Title: Re: bash script help needed
Post by: PingPing on June 05, 2009, 08:02:23 AM
Duh!  **bangs head against wall**.
Thanks.