|
|||||||
| Forums | Search Forums | Register | Forum Rules | Man Pages | Albums | FAQ | Members | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
|
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
||||
|
||||
|
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 |
| Sponsored Links | ||
|
|
#2
|
||||
|
||||
|
If you are using echo to print the address back to the user, then try Code:
echo -E "c:\tuser\abc" From the man pages of echo Code:
-e enable interpretation of the backslash-escaped characters listed
below
-E disable interpretation of those sequences in STRINGsMan pages of sh, ksh also mention the usage of echo -E to disable interpretation. |
| Sponsored Links | ||
|
|
#3
|
||||
|
||||
|
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 |
|
#4
|
||||
|
||||
|
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" |
| Sponsored Links | |
|
|
#5
|
||||
|
||||
|
Thanks Vino
|
| Sponsored Links | ||
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help with escape sequence for '$' symbol in EGREP function | xylus77 | Shell Programming and Scripting | 3 | 03-14-2012 04:02 PM |
| Removing Escape Sequence Characters | cutechaps | Shell Programming and Scripting | 2 | 04-29-2010 12:18 AM |
| escape sequence for $ | shreekrishnagd | Shell Programming and Scripting | 5 | 08-26-2008 09:47 AM |
| Both HOME and INSERT key send same escape sequence on ssh | grossgermany | UNIX for Dummies Questions & Answers | 0 | 07-27-2007 07:12 PM |
| want to view the escape sequence | sweta | UNIX for Advanced & Expert Users | 4 | 10-09-2006 10:20 AM |
|
|