Hello.
"Raghu Kumar Y." wrote:
> We have shell scripts which works on Digital, SunOS and AIX
> machines. Recently we ported our scripts on Linux machine.
> On Linux machine echo is behaving differently because of
> this we are facing some problems.
> i.e
> echo "raghu\tkumar"
> raghu\tkumar
> Same command on SunOS giving "raghu kumar" output.
> On Linux machine we need to use -e switch to expand
> backslash-escape characters which is not there in other
> machines.
> When I modified echo.c source and uncommented line no 53
> (#define V9_DEFAULT), then it is working fine.
> Please confirm this modifications is correct or not.
That depends on what you want 'echo "raghu\tkumar"' to display. I'm assuming
that you want it to output a tab. If so, why not just embed a tab in the
string? That avoids having to modify echo on every Linux box you'll ever want
to run the script on.
Or you could implement a run-time test:
if uname | grep -i linux >/dev/null 2>&1; then
ECHO="echo -e";
else
ECHO="echo";
fi
and then use $ECHO in all places.
Regards,
--
Richard Dawe [ http://www.phekda.freeserve.co.uk/richdawe/ ]
_______________________________________________
Bug-sh-utils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-sh-utils