Oil [1] supports all of this old syntax to run existing shell scripts, but has new syntax which is more convenient.
- You can write @ARGV instead of "$@".
- You can write @myarray instead of "${myarray[@]}"
(Related: Thirteen Incorrect Ways and Two Awkward Ways to Use Arrays https://www.oilshell.org/blog/2016/11/06.html )
Example:
oil$ var myarray = @('has spaces' foo)
oil$ var s = $'has\ttabs'
# function to print an array element on each line
oil$ lines() { for x in @ARGV; do echo $x; done }
# pass 3 args -- 2 from myarray and 1 from s
oil$ lines @myarray $s
has spaces
foo
has tabs
[1] https://www.oilshell.org/