Derek Martin wrote:
> If you want to use escape sequences portably in your echo commands,
> then you end up having to write silly code like this:

The way I do it is something like a little include that sets $ECHO to be
the relevant command:

case $OS in
  $SYSV) echo="/bin/echo -e";;
  $BSD)  echo="echo";;
  $LSB)  echo="/usr/bin/echo";;
esac

I source this from scripts that need to echo output and then write my
scripts to use $ECHO instead of echo:

$ECHO "here is a line with a newline\n"

Tricks like that were necessary when wrangling some 20 different UNIXes.

-- 
Rich P.
_______________________________________________
Discuss mailing list
[email protected]
http://lists.blu.org/mailman/listinfo/discuss

Reply via email to