Hi All,
I have got an echo statement with "\c" in it to avoid getting into a newline. Ths script is using #!\bin\sh
Any idea what could make it to escape "\c"
Hi All,
I have got an echo statement with "\c" in it to avoid getting into a newline. Ths script is using #!\bin\sh
Any idea what could make it to escape "\c"
Perhaps you can use:
print -n
bye
You are breaking the rules by bumping up posts. Moderators, please merge this thread with Which SHELL is this ?
You havent shown us what command you issued. Without that we cant help you.
Try reading the man pages as well. They have documented the use of \c very well.
See this.
[/tmp]$ cat try.sh
#! /bin/sh
echo -e "Line 1\c"
echo ""
echo -n "Line 2"
[/tmp]$ ./try.sh
Line 1
Line 2[/tmp]$
From man sh
echo [-neE] [arg ...]
Output the args, separated by spaces, followed by a newline.
The return status is always 0. If -n is specified, the trailing
newline is suppressed. If the -e option is given, interpreta-
tion of the following backslash-escaped characters is enabled.
i am sorry, i just forget that i have mentioned this question in my other thread which actually started with another question
echo "adbcd \c"
echo -n "abcd"
Both are working for SH and BASH respectively, but at Production site i don't know what has happened wrong that is causing \c to escape.
Thanks Folks for your Patience (sorry for my quick posts)
echo is most inconsitent thing. There is a SYSV3 variable on Unix which tends to change the behaviour of echo command or shell-builtin.