Created
December 2, 2019 21:53
-
-
Save junhan-z/232c0599477eb7f0cd3c0b0e29fbf79a to your computer and use it in GitHub Desktop.
To reference the last argument passed to a script
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
args=$# # Number of args passed. | |
lastarg=${!args} | |
# or: | |
# lastarg=${!#} | |
echo $lastarg |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment