Question 12 of 20Pro Only

What is the difference between $@ and $* in Bash? When would you use one over the other?

Sample answer preview

Both $@ and $* represent all the positional parameters passed to a script, but they behave differently when quoted. Without quotes, they are essentially the same. Both expand to all arguments separated by spaces.

$@$*positional parametersIFSargument preservationquoting

Unlock the full answer

Get the complete model answer, key points, common pitfalls, and access to 19+ more DevOps Engineer interview questions.

Upgrade to Pro

Starting at $19/month • Cancel anytime