First commit
This commit is contained in:
11
arguments.sh
Executable file
11
arguments.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "Last argument only (works with bash/ksh only): ${@: -1}"
|
||||
echo "Last argument only (works with bash 3.x+ only): ${!#}"
|
||||
echo "Last argument only (works with bash 3.x+ only): $BASH_ARGV"
|
||||
echo "Last argument only (works with bash 3.x+ / ksh only): ${@:$#}"
|
||||
echo "Last argument only (works with bash 3.x+ only): ${BASH_ARGV[0]}"
|
||||
|
||||
echo -n "Last argument only (portable version): "
|
||||
for i in $@; do :; done
|
||||
echo "$i"
|
||||
Reference in New Issue
Block a user