Positional parameters beyond $9

Paul Slootman slootman at dri.nl
Tue Apr 16 18:07:23 AEST 1991


Hi,
I've just come across a detail of (Bourne) shell programming that I've
not seen before. If a script has more than 9 positional parameters,
there seems to be no way to *directly* access the tenth onwards. Try
this:

$ set a b c d e f g h i j k l m n o p
$ echo $9
i
$ echo $10
a0
$ echo ${10}
sh: bad substitution

Is this a "feature"? The ksh does it ok, but that's not an option for
all the systems we have here. We've done a workaround by assigning to
other variables and shifting, but I was wondering if there isn't any
other way. Nothing in TFM states anything about problems with more
than 9 parameters (unless I've overlooked it...)

FYI, it's on System V systems.

Paul.
-- 
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
: slootman at dri.nl           : You are wise, witty and wonderful, but you      :
: ...!hp4nl!dri500!slootman : spend too much time reading this sort of trash. :
 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=



More information about the Comp.unix.shell mailing list