Created
August 14, 2012 14:07
-
-
Save ziz/3349556 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
#!/bin/bash | |
echo $1; | |
while shift; do | |
echo $1; | |
done |
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
+ foo='a b c '\''*'\'' d e f' | |
+ echo 'no quotes' | |
no quotes | |
+ ./bar.sh a b c ''\''*'\''' d e f | |
a | |
b | |
c | |
'*' | |
d | |
e | |
f | |
+ echo quotes | |
quotes | |
+ ./bar.sh 'a b c '\''*'\'' d e f' | |
a b c '*' d e f | |
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
#!/bin/bash | |
set -x | |
foo="a b c '*' d e f" | |
echo "no quotes" | |
./bar.sh $foo | |
echo "quotes" | |
./bar.sh "$foo" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment