Created
May 1, 2016 14:27
-
-
Save pr00thmatic/9328dbe6bffa5ef95fc41d6ede00ca95 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/bin/bash | |
# $@ contiene todos los argumentos pasados al script (es un array) | |
# $* !== $@, porque cuando le pasas al script un argumento entre comillas, | |
# Si ejecutamos el script: ./pass-arguments.sh "a b c": | |
# $@ lo leerá como un item de su array. "a b c" está en $@[0] | |
# $* lo leerá como tres items de su array. a está en $*[0] | |
echo "The arguments are: ""$@"; | |
echo "printing'em one by one..." | |
for i in "$@"; do | |
echo $i | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment