the shell passes more than just 9 parameters to your script, there is a limitation in length however. I'm not quite sure about the actual value of today's shells, in former time 8 kB have been a common value. Check for your implementation.
Within the script you can access the parameter 10 and above via
Bourne positional parameters are 1-9 AND Korn positional parameters go higher
using ${parameter} such as 10 would be ${10} and 11 would be ${11} etc....
if using a plain old shell script, to access from the 10th
argument up, you must use shift. For instance, to print
the first 3 lines of every file passed, with a litte
header:
while test $# -gt 0; do
echo "==== $1 ===="
sed 3q "$1"
shift
done
also, the "for" construct with no list, runs through
all passed arguments. For example, the above could
have been written as:
for file
do
echo "==== $file ===="
sed 3q "$file"
done
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.