Hacker News new | ask | show | jobs
by minamea 4784 days ago
Well I think there are if statements, loop conditions, and wildcard expansion that works in zsh but not in bash. So you could get used to something working in zsh, then you write an sh script with that thing, and then it doesn't work, and you have no idea why.

Example, I _think_ / (recursive globbing) works by default in zsh but not in bash. If you have / in a bash script without setting the right options then your script won't work and you will have no idea why until you've wasted a lot of time debugging.

1 comments

When you insert this in the first line of your script

    #!/bin/bash
The specified program is run. From that point on, the bits you're executing in that script are 'bash' no matter what the shell you called it from is.

I've been running zsh on my local system, and happily writing [bash, csh, perl, ruby] using this trick.