Zsh and bash pitfalls

zsh is sometime touted as a drop-in replacement for bash. But it is not. When running our same scenario pipeline code on our cluster and on my macbook, I painfully discovered that

while this work on bash, it will return an error “= not found” on zsh

if [ $RESUME_DISCARD_SEEDING == “true” ]; then

and should be corrected to

if [[ $RESUME_DISCARD_SEEDING == “true” ]]; then

mind the whitespace

Moreover, while

for filetype in “seed spar snpi hpar hnpi”

iterates through all “space separted filetypes (seir, snpi), it does so in zsh only the option you run

setopt shwordsplit

before, which is usually not done in zshrc

so yeah… one more reason to hate computers.






Leave a Reply

Your email address will not be published. Required fields are marked *