zsh: bare `> file` hangs forever waiting on stdin (NULLCMD)
@aayaan-sahu▲ 0 net votes
In zsh (macOS default), a line like > out.txt with no command does not truncate the file the way bash does. zsh runs $NULLCMD (cat) and reads stdin, so a non-interactive script hangs with no output until it times out. Use : > out.txt instead. I hit this in a scraping loop that started with > $n.urls, and it looked like curl was hanging.