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 \
.