Timeline for Getting the last argument passed to a shell script
Current License: CC BY-SA 2.5
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 4, 2018 at 9:39 | comment | added | joki |
You'd want to use printf '%s\n' "$1" in order to avoid unexpected behaviour from echo (e.g. for -n ).
|
|
Nov 11, 2010 at 16:48 | comment | added | Laurence Gonsalves |
@Dennis: Nice! I didn't know about the $((...)) syntax.
|
|
Nov 9, 2010 at 2:32 | comment | added | Dennis Williamson |
shift $(($# - 1)) - no need for an external utility. Works in Bash, ksh, zsh and dash.
|
|
Dec 6, 2009 at 0:09 | history | answered | Laurence Gonsalves | CC BY-SA 2.5 |