Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Substitution of ! with sed leads to event not found

Tags:

sed

csh

tcsh

I need to change every occurrence of ! to : as field separators in a group file.

sed 's/!/:/g' filename > newfilename 

But I get the error /: Event not found?

like image 359
user2358660 Avatar asked May 07 '13 14:05

user2358660


Video Answer


1 Answers

You are using csh so the ! is being interpreted to fix this escape the ! or just use bash:

sed 's/\!/:/g' file > outfile

With csh the ! used for command history reference and it works even inside a pair of apostrophes ' or quotation marks ", unless escaped with a backslash \.

like image 50
Chris Seymour Avatar answered Nov 17 '22 09:11

Chris Seymour