buschi
July 30th, 2007, 08:51 AM
Hi!
Is there a special reason (or am I simply too dumb to discover it) for rm not having an option to exclude some files? It is easy to erase all tex-files in a folder with
rm *.tex
However, if I want to erase all files except the tex-files, I have to use something like
rm `ls * | grep -v ".tex"`
If someone knowing C who wants to save me from replacing /bin/rm with an evil bash-script introducing a -x option feels like this was a good starting point to revolutionize coreutils, I am happy about any snippets... (already took a look at rm.c but can't even figure out where the actual "remove it" steps takes place :/)
Any advice why this is a really bad idea is also appreciated,
Sebastian.
Is there a special reason (or am I simply too dumb to discover it) for rm not having an option to exclude some files? It is easy to erase all tex-files in a folder with
rm *.tex
However, if I want to erase all files except the tex-files, I have to use something like
rm `ls * | grep -v ".tex"`
If someone knowing C who wants to save me from replacing /bin/rm with an evil bash-script introducing a -x option feels like this was a good starting point to revolutionize coreutils, I am happy about any snippets... (already took a look at rm.c but can't even figure out where the actual "remove it" steps takes place :/)
Any advice why this is a really bad idea is also appreciated,
Sebastian.