Quote:
Originally Posted by
somu_june
As Tene mentioned I'm using back slah "\" to remove special features associated with character like cat and equal sign character in file. But I'm getting below error.
Thanks,
Raju
btw, cat is not a character.
By characters I meant special ones used in unix commands like $,^,|,/ etc.
If you want to use any of these characters, not for its feature, you have to escate it using backslash.
Eg: $ is used to represent end of a line in unix.
But if you want to represent it as a normal character in a string you have to escape it with backslash, telling the shell interpreter that
"Hello Shell, Please dont give '$' any special meaning as you would;but its a normal character in my string"
Let me give you an example.
There is an input file like this.
XX|$$|YY
YY|$$|ZZ
%s/$/AA/g
This command will change the file as below
XX|$$|YYAA
YY|$$|ZZAA
because shell interpreted $ as end of line.
======================================================
%s/\$\$/AA/g
This command will change the file as below
XX|AA|YY
YY|AA|ZZ
because, you escaped $ . So shell will not interpret $ as end of file, but as a normal character.
Let me know if you have more doubts.