Created
April 10, 2017 17:56
-
-
Save bowei/3f367af860bd364de8f65140c710c687 to your computer and use it in GitHub Desktop.
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
function foo() { | |
a=$1 | |
shift | |
b=$1 | |
shift | |
c=$1 | |
shift | |
echo "a='${a}' b='${b}' c='${c}'" | |
} | |
x= | |
foo | |
foo 1 | |
foo 1 2 | |
foo 1 2 3 | |
echo ==== | |
foo "" 2 | |
# Quoted args are not merged | |
foo "" "" 3 | |
foo "" "" "" | |
# Empty string vars are empty and will be eaten... | |
foo ${x} ${x} "${x}z" | |
# Not if it is quoted... | |
foo "${x}" "${x}y" "${x}z" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment