hey
i want to know the unix commands to replace all the character escape sequences with their "C" values in a string...
thanks in advance..!
Regards,
Sharanya
What do you mean by C sequences? Do you mean that you want the hex values of the escape sequences? You could look at 'od'.
The C is character values...like\" shud be replaced by " ..\t is replaced by horizontal tab\v by vertical tab and so on..
hii..
thatz the exact one i need but i need unix shell script commands for that..
I guess we can use sed command for this but then i am understanding how to use it...
do you mean that you want to read a text file and wherever a newline is present, replace it with \n, wherever a single quote is present, replace it with \' etc.?
I have a string which is to be parsed and all the character escape sequences shud be replaced with their "C" values.
I think sed statement must be used..but iam not sure abt how to go.
s=abdcj\n\t\\"
what do you mean by "C" value?
in that string, do you want to replace \n with its ASCII (or UTF-8, or whatever) equivalent, \t with its ASCII equivalent \" with its ASCII equivalent (which should happen to be ") etc.?
Character Escape Sequence
" \"
' \'
? \?
\ \\
BEL \a
BS \b
FF \f
NL \n
CR \r
HT \t
VT \v