Created
November 14, 2018 12:44
-
-
Save jgrant41475/8176ed8dfc858a0d8dd4db691f156dcb 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 | |
mstring=$* | |
set -- $mstring | |
if [[ -z $mstring ]]; then | |
echo NULL | |
else | |
for a in $*; do | |
echo "$#: " $a | |
done | |
fi | |
echo "--------------------------" | |
echo $2 |
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 | |
echo "Using \"\$*\":" | |
for a in "$*"; do | |
echo $a; | |
done | |
echo -e "\nUsing \$*:" | |
for a in $*; do | |
echo $a; | |
done | |
echo -e "\nUsing \"\$@\":" | |
for a in "$@"; do | |
echo $a; | |
done | |
echo -e "\nUsing \$@:" | |
for a in $@; do | |
echo $a; | |
done |
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 | |
files=$(ls /home/john/) | |
echo $files | |
echo "=============================" | |
set -- $files | |
echo $1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment