This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] opts.sh & posix


On Jun 14, 2003, Nathan Sidwell <nathan@codesourcery.com> wrote:

> + # Must unset this, so that the gawk extension RS="" works.
> + unset POSIXLY_CORRECT

Note that unset is not a portable shell construct.  The portable
construct that has similar effects is:

if (unset FOO) 2 > /dev/null; then unset FOO; else FOO=; fi

If unset is not supported, and the code depends on whether the
environment variable is set or not, as opposed to set to a non-empty
string, it still loses, but that's the best you can do in portable
shell scripting.

-- 
Alexandre Oliva   Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer                 aoliva@{redhat.com, gcc.gnu.org}
CS PhD student at IC-Unicamp        oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist                Professional serial bug killer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]