How can i search the occurrence of
Clear;Clear;ic/In/2011 :
and replace with
X25
in a file?
i used
sed 's/Clear;Clear;ic/In/2011 :/X25/g'
but keeps giving me error. any help?
How can i search the occurrence of
Clear;Clear;ic/In/2011 :
and replace with
X25
in a file?
i used
sed 's/Clear;Clear;ic/In/2011 :/X25/g'
but keeps giving me error. any help?
>cat /tmp/a
Clear;Clear;ic/In/2011 :
>cat /tmp/a | sed "s!Clear;Clear;ic/In/2011 :!X25!g"
X25
$ ruby -ne 'puts $_.gsub(/Clear;Clear;ic\/In\/2011/, "X25")' file
dfs
X25 :
safsf
In some shells, the exclamation point triggers history expansion (even when double quoted). In this case, since there's no need for parameter expansion or command subsitution, simply use the stronger single quotes.
Regards,
Alister