execline
Software
skarnet.org
The $@ program
$@ prints the positional parameters of an execline script.
Interface
$@ [ -n ] [ -0 | -d delimchar ]
- $@ reads the number n of "positional
parameters" in the # environment variable. If that variable
is not set or does not contain a valid n, $@
exits 100.
- $@ prints the value of the 1 environment
variable, then delimchar, then the value of the 2
environment variable... and so on until n. If one of
these variables is not set, $@ exits 100.
- If everything runs OK, $@ exits 0. This makes it
one of the rare "exiting" execline commands.
Options
- -n : chomp. Do not print the last
delimchar.
- -d delimchar : use the character
delimchar as separator between the arguments. Default: \n.
If delimchar has more than one character, only the first one is
used. If delimchar is the empty string, then $@
will output the positional parameters as a
sequence of netstrings (and the
-n option will be ignored).
- -0 : use the null character as separator. Any -d
argument will be ignored. Warning: this option should only be used to feed
data to programs that know how to handle null-separated lists.
Notes