Run the script below and feel the difference 😉
shell]$ cat input
#! /bin/bash
echo “$# inputs”
echo “”
echo ‘”$@” output’
for arg in “$@”; do
echo $arg
done
echo “”
echo ‘$@ output’
for arg in $@; do
echo $arg
done
echo “”
echo ‘”$*” output’
for arg in “$*”; do
echo $arg
done
echo “”
echo ‘$* output’
for arg in $*; do
echo $arg
done
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
shell]$ ./input a b ‘c d’
3 inputs
“$@” output
a
b
c d
$@ output
a
b
c
d
“$*” output
a b c d
$* output
a
b
c
d
shell]$