Unix Shell - XSI echo (was Re: Array saving)

This is Interesting: Free IT Magazines  
Home > Archive > Unix Shell > October 2004 > XSI echo (was Re: Array saving)





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author XSI echo (was Re: Array saving)
Geoff Clare

2004-10-02, 9:13 pm

"Stephane CHAZELAS" <this.address@is.invalid> wrote, on Thu, 30 Sep 2004:

> bash has a compile time option to have the conformant behavior:
> --enable-usg-echo-default
> a synonym for --enable-xpg-echo-default
> --enable-xpg-echo-default
> make the echo builtin expand escape sequences by
> default


With this option enabled, bash's echo is still not quite XSI conformant.
(At least, bash 2.05b is not; I don't know if it has changed in 3.0.)

This much is correct:

bash$ shopt -s xpg_echo
bash$ echo 'ab\tc'
ab c

But this is not:

bash$ echo -E 'ab\tc'
ab\tc

An XSI conformant echo would do this:

$ echo -E 'ab\tc'
-E ab c

--
Geoff Clare <nospam@gclare.org.uk>
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com