From: Jim Segrave (jes@grendel.demon.co.uk)
Date: 10/11/92


From: jes@grendel.demon.co.uk (Jim Segrave)
Subject: ! on the command line?
Date: 11 Oct 1992 18:54:10 GMT

I'm running -/97 patch 6 with bash. I was playing around with a script
file with sed and trying to enter a !cmd -

file * | sed '/text/!d'

to list only those files which are text files of some sort.
Bash terminated the command line input before the closing quote, giving
an error message about no event d. I thought bash wouldn't look inside
quoted strings? Is there any way (short of putting the sed expression in
a file) of getting bash to not attempt to expand the '!' ?
I tried escaping it with backslash, which worked, but then sed
complained that it saw an unknown command - implying that the backslash
was (correctly I think) not stripped by the shell's command line parser.