In Bourne shell and its offshoots like Bash, I believe the only difference between $* and $@ is that $@ expands in double quotes so that each argument ends up as a single word even if it contained embedded whitespace while $* doesn't.#!/bin/shfor i in $*; do echo $i; donefor i in $@; do echo $i; donefor i in $*; do echo $i; donefor i in $@; do echo $i; done...when invoked with '1 2' 3 as arguments, the first two output 1, 2, then 3, the thrid outputs 1 2 3, but the fourth correctly outputs 1 2 then 3.Is $* just redundant, and if it is, why is it used in so many scripts?
When would you use $* instead of $@ in Bourne shells?
bash;shell;shell script;bourne shell