Dear Stephane, thanks.
On Wed, Dec 16, 2015 at 7:36 PM, Stephane Chazelas <stephane.chaze...@gmail.com> wrote: > What's wrong with > > f=/tmp/myfile; [ -f "$f" ] && { echo "$f is here"; head -n 1 < "$f"; } nothing. sometimes it is just not practical (see my answer to Chet's comment) and sometimes you just want to get that argument given to test. > > A few shells (es, zsh, others) have support for > lambdas/anonymous functions which could be another alternative. [..] ok, but that isnt that practial for me. > [..] > $_ as the last argument of the last command or history expansion > are generic enough but having $^ as the last argument to test -f > seems too specific (and obscure) to me and a waste of a special > variable. well, maybe, but dont you think it could help? a way to get all the arguments given to all the test calls? what do you think of the two examples in the reply to Chet's response? sincerely, pg