Will this break all those or are bash scripts and zsh scripts basically interchangeable?
Will this break all those or are bash scripts and zsh scripts basically interchangeable?
But if you did want to run them with zsh, most simple scripts that just set environment variables, string together commands, or redirect to files should work without any changes. The most obvious difference for basic scripts like that is that zsh doesn't split parameter-expansions on white space by default (so if you did something like `opts='-a -b -c'; mycmd $opts` it wouldn't work without additional, minor, modifications)
I'd been using ZSH for a year as if it was Bash with better history and much better completions. The difference mentioned above was the only one I knew about. I kept writing my scripts in Bash and was quite happy with the UX.
Cool! I do use shebangs, but my concern is that moving forward bash may not be ported to macOS. (Or will I probably be able to, worst case, compile it myself?)
Maybe I'll write a bash script to prep my poorly written bash scripts :D
Of course it goes without saying that you shouldn't use #!/bin/sh then use bash...