Escape sequence

Hi,

I have got an application through which an user will submit an address like "c:\tuser\abc".
This application calls a script and passes the address to the scripts positional parameter say $1.
So $1 should contain "c:\tuser\abc", but when $1 is echoed the "\t" and "\a" are interpreted to escape sequence 'tab' and 'bell'.
I cannot ask the user to enter the address in any other format.
Please let me know how to resolve this issue.

TIA,
Puspendu

If you are using echo to print the address back to the user, then try

echo -E "c:\tuser\abc"

From the man pages of echo

       -e     enable interpretation of the backslash-escaped characters listed
              below

       -E     disable interpretation of those sequences in STRINGs

Man pages of sh, ksh also mention the usage of echo -E to disable interpretation.

Hi Vino,

Thnx for the quick reply but as we know the echo command varies a lot across different shell, so is the case here.

I am on 'AIX' and 'ksh' shell.

So the -e/-E options are not supported, I also confirmed from the man pages for echo.

Regards,
Puspendu

Since you are using ksh as the shell, try

print -r "c:\tuser\abc"

I am not very sure about the following command. But try.

printf "%s\n" "c:\tuser\abc"

Thanks Vino