Extension Development :: Script required to delete a list of files?
Thanks:
Code Sample
$ for F in `cat files_list`; do echo "$F"; done [to test/double-check] # for F in `cat files_list`; do rm "$F"; done
- does indeed delete the files in files_list
On a connected topic:
Code Sample
$ tar -tzf ../myapp.dsl > files_list
- will produce a list of files without the leading "/" required by the delete loop above. Is there a way to have the leading "/" without adding it by hand?The leading / is removed when the package is created. Probably the easiest thing to do is "cd /" before removing files.fyi, those code snippets would only work on filenames not containing whitespace. You could set IFS to newline or use `while read LINE; do echo $LINE; done < filelist ` (which can be more resource friendly afaik)also, an alternative to cd: while read LINE; do echo "/$LINE"; done < filelist
original here.