Re: "unset var" pops var off variable stack instead of unsetting it

2017-03-19 Thread Stephane Chazelas
2017-03-18 13:16:56 -0400, Chet Ramey: > On 3/17/17 5:51 PM, Stephane Chazelas wrote: > > > Now, if that "split" functions is called from within a function > > that declares $IFS local like: > [...] > > because after the "unset IFS", $IFS is not unset (which would > > result in the default s

Re: "unset var" pops var off variable stack instead of unsetting it

2017-03-19 Thread Chet Ramey
On 3/19/17 5:51 PM, Stephane Chazelas wrote: > On comp.unix.shell ot http://unix.stackexchange.com, I've posted > many articles describing how to do splitting in POSIX-like > shells: > > ( # subshell for local scope > unset -v IFS # restore default splitting behaviour > set -o noglob # disab

Re: "unset var" pops var off variable stack instead of unsetting it

2017-03-19 Thread Stephane Chazelas
2017-03-19 18:05:19 -0400, Chet Ramey: > On 3/19/17 5:51 PM, Stephane Chazelas wrote: > > > On comp.unix.shell ot http://unix.stackexchange.com, I've posted > > many articles describing how to do splitting in POSIX-like > > shells: > > > > ( # subshell for local scope > > unset -v IFS # restor

Re: "unset var" pops var off variable stack instead of unsetting it

2017-03-19 Thread Chet Ramey
On 3/19/17 6:22 PM, Stephane Chazelas wrote: >> $ cat x2 >> function foo >> { >> ( >> unset -v IFS >> recho "${IFS-unset}" >> ) >> } >> >> IFS=':|' >> foo >> echo after IFS = "$IFS" >> $ ../bash-4.4-patched/bash ./x2 >> argv[1] = >> after IFS = :| > > Yes, that one is fine but it is n

Re: "unset var" pops var off variable stack instead of unsetting it

2017-03-19 Thread Peter & Kelly Passchier
On 20/03/2560 04:51, Stephane Chazelas wrote: > On comp.unix.shell ot http://unix.stackexchange.com, I've posted > many articles describing how to do splitting in POSIX-like > shells: > > ( # subshell for local scope > unset -v IFS # restore default splitting behaviour > set -o noglob # disab

Odd LINENO behaviour in 'eval'

2017-03-19 Thread Martijn Dekker
Test script: printf "$LINENO " printf "$LINENO " eval ' printf "$LINENO " printf "$LINENO " printf "$LINENO " ' printf "$LINENO\n" Output on various shells: bash: 1 2 5 6 7 6 (?!) {m,l,pd}ksh: 1 2 0 0 0 6 (?) AT&T ksh88: 1 2 3 3 3 6 AT&T ksh93: 1 2 1