On Friday, May 02, 2014 07:00:25 AM Dan Douglas wrote:
> Hi, It appears that _ is only actually set to the last argument of the
> previous "list", not the previous "command" as stated in the manual.
> (unless the manual's definition of "command" differs from my
> understanding.)
>
> $ ksh <<\EOF
> : first
> : second; print -v _ .sh.version
> EOF
>
> first
> Version AIJM 93v- 2014-01-14
>
> Bash and zsh always set _ to the final argument of the most recently
> evaluated simple command.
>
So it's been brought to my attention that apparently ksh has always done
this. At least it isn't a regression.
I don't care for it much because some tricks will fail depending on
whether the second command is physically on a separate line:
source ~/foo/"$someFile" || printf 'Failed sourcing file %s\n' "$_" >&2
Which is kind of a hack to begin with, but convenient.
--
Dan Douglas
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users