

For example, how could it know whether
cat $foo
should becat "$foo"
, or whether the script actually relies on word splitting? It’s possible that$foo
intentionally contains multiple paths.
Last time I used ShellCheck (yesterday funnily enough) I had written ports+=($(get_elixir_ports))
to split the input since get_elixir_ports
returns a string of space separated ports. It worked exactly as intended, but ShellCheck still recommended to make the splitting explicit rather than implicit.
The ShellCheck docs recommended
IFS=" " read -r -a elixir_ports <<< "(get_elixir_ports)"
ports+=("${elixir_ports[@]}")
I’m not anti bash or fish, I’ve written in both just this week, but if we’re talking about readability/syntax as this post is about, and you want an alternative to bash, I’d say python is a more natural alternative. Fish syntax is still fairly ugly compared to most programming languages in my opinion.
Different strokes for different folks I suppose.