LINENO oddities

2017-03-19 Thread Martijn Dekker
LINENO is set to zero during the execution of aliases or commands in 'eval'. This behaviour is different from that of other shells. #! /usr/bin/env mksh alias showlineno='echo $LINENO' eval 'echo $LINENO' showlineno Actual output: 0 0 Expected output: 3 (or 1) 4 This behaviour seems to be

Re: LINENO oddities

2017-03-19 Thread Thorsten Glaser
Martijn Dekker dixit: >LINENO is set to zero during the execution of aliases or commands in >'eval'. This behaviour is different from that of other shells. Patches welcome ☺ (What do you *use* LINENO for? I’ve *never* seen it used *at all*.) >Output on various shells: >mksh: 1 2 0

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 #