...
We;ve already touched on difference kinds of Quoting in the shell. But there is an additional subtleties subtlety when handling script arguments.
Specifically: quoting a positional argument preserves argument quoting/grouping by the caller.
So there's a difference between these two ways of calling the helloWorld function inside our script:
Code Block | ||
---|---|---|
| ||
# Wihout quotes, all argument grouping by the script caller is lost helloWorld $@ # With quotes, argument quoting by the script caller is preserved helloWorld "$@" |
...