Skip to content

Instantly share code, notes, and snippets.

@jgrant41475
Created November 14, 2018 12:44
Show Gist options
  • Save jgrant41475/8176ed8dfc858a0d8dd4db691f156dcb to your computer and use it in GitHub Desktop.
Save jgrant41475/8176ed8dfc858a0d8dd4db691f156dcb to your computer and use it in GitHub Desktop.
#!/bin/bash
mstring=$*
set -- $mstring
if [[ -z $mstring ]]; then
echo NULL
else
for a in $*; do
echo "$#: " $a
done
fi
echo "--------------------------"
echo $2
#!/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
#!/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