Public feed #533128

Stuff

public shellscript v1 · immutable
Raw Edit
·published 2007-06-03 10:57 UTC
rendered paste body
Bracket notation for positional parameters leads to a fairly simple way of referencing the last argument passed to a script on the command line. This also requires indirect referencing.args=$#           # Number of args passed.lastarg=${!args}# Or:       lastarg=${!#}#           (Thanks, Chris Monson.)# Note that lastarg=${!$#} doesn't work.