I want to, in a directory, delete all files but the ones ending with .c
somewhere I read that this line would do it:
rm $(ls -1|grep -v ".c$")
but I just get the following output:
Illegal variable name.
I understand the "ls -1|grep..." part, but not how I redirect that output
to an input for the rm command.
Can anyone out there help me?