Skip to content

Instantly share code, notes, and snippets.

@pr00thmatic
Created May 1, 2016 14:27
Show Gist options
  • Save pr00thmatic/9328dbe6bffa5ef95fc41d6ede00ca95 to your computer and use it in GitHub Desktop.
Save pr00thmatic/9328dbe6bffa5ef95fc41d6ede00ca95 to your computer and use it in GitHub Desktop.
#!/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