Brian Pontarelli
Found a way to do this in a single line. Works nicely.
eval "last=\\${$#}"
To get the REST of the parameters:
eval “rest=\”`for d in \`seq 1 \$[\$# - 1]\`; do echo -n \\\$\$d\ ; done`\”"
The following works better:
eval “last=\\${$#}”
Crap. It’s the following that works better:
eval “last=\${$#}”
$(echo $@ |cut -d\ -f $#)
last=$(echo $@ |cut -d\ -f $#)
Name (required)
E-Mail (will not be published) (required)
Website
To get the REST of the parameters:
eval “rest=\”`for d in \`seq 1 \$[\$# - 1]\`; do echo -n \\\$\$d\ ; done`\”"
The following works better:
eval “last=\\${$#}”
Crap. It’s the following that works better:
eval “last=\${$#}”
$(echo $@ |cut -d\ -f $#)
last=$(echo $@ |cut -d\ -f $#)