[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#95430 acknowledged by developer (Re: Bug#95430: ash: word-splitting changes break shell scripts)



Shaul Karl <shaulka@bezeqint.net> writes:
> Russ Allbery <rra@stanford.edu> writes:
> > windlord:~> printenv IFS
> > windlord:~> /bin/sh -c 'echo x-${IFS}-x'
> > x- -x
> > windlord:~> uname -a
> > SunOS windlord.stanford.edu 5.6 Generic_105181-19 sun4u sparc SUNW,Ultra-1
> > 
> > Looks set to me, although it appears to be set incorrectly.
>
> Incorrectly? Looks to me the same as with bash:
> [16:24:40 tmp]$ printenv IFS
> [16:24:46 tmp]$ bash -c 'echo x-${IFS}-x'
> x- -x
> [16:24:48 tmp]$ bash --version
> GNU bash, version 2.05.0(1)-release (i386-pc-linux-gnu)
> Copyright 2000 Free Software Foundation, Inc.
> [16:27:28 tmp]$ 
> 
> Ah, something might be wrong with the above tests:

Maybe you want

  sh -c 'echo "x-${IFS}-x"'

Both Solaris 2.6 /bin/sh and Linux bash seem to have IFS set.

$ /bin/sh -c 'echo "x-${IFS}-x"'
x- 
-x

- Hari
-- 
Raja R Harinath ------------------------------ harinath@cs.umn.edu
"When all else fails, read the instructions."      -- Cahn's Axiom
"Our policy is, when in doubt, do the right thing."   -- Roy L Ash



Reply to: