[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
no "shift" to pluck off high numbered parameters
From: |
Dan Jacobson |
Subject: |
no "shift" to pluck off high numbered parameters |
Date: |
21 May 2002 05:57:24 +0800 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 |
Gentlemen, "shift" plucks parameters off the low end of $*. There is
no corresponding "shift" to pluck parameters from the high end of $*.
Prejudice I tell ya!
set a b c d e f g h i j
shift 2 #bye bye a b
shift -2 #bye bye i j #I wish
shift 0 #bye bye all of them #I wish
Oh, and while I'm here yapping my jaws:
Unfair! Positional parameters always referred from the left: $1,
$2... No $-1, $-2 ... to refer from the right end of the list!
Leftist conspiracy.
Wait, there is a painful way:
$ set a b c d e f
$ eval echo \$$(($#-1))
e
And I bet tons more ways that I don't know about.
--
http://jidanni.org/ Taiwan(04)25854780
- no "shift" to pluck off high numbered parameters,
Dan Jacobson <=