Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

LINENO behaviour in sh mode



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 2 3 6
      FreeBSD sh: 1 2 1 2 3 6
            dash: 1 2 1 2 3 6
            yash: 1 2 1 2 3 6
    zsh (native): 1 2 1 2 3 6
        zsh (sh): 1 2 3 3 3 6  (like ksh88)

Since ksh88 is dead and buried (even Solaris now has ksh93 as their
/bin/sh), it looks like zsh's "sh" mode is not emulating any current sh.
Maybe 'emulate sh' should no longer turn off the EVAL_LINENO option.

- M.



Messages sorted by: Reverse Date, Date, Thread, Author