What is the difference between $* and $@ in bash?
⚡
Quick Answer
"$@" expands each argument as a separate quoted word; "$*" joins all arguments into one string.
Detailed Answer
Inside double quotes, "$@" is what you almost always want — it preserves argument boundaries so files with spaces stay intact. "$*" concatenates with IFS (space by default) into a single word, which loses boundaries. Unquoted, both word-split.
💡
Interview Tip
"$@" for forwarding args is the practical takeaway.
bashargumentspositional