Live data from Hacker News

Zsh-autoquoter makes shell quoting slightly less annoying

ianthehenry.com

1–10 of 27 posts

Re: Zsh-autoquoter makes shell quoting slightly less annoying

#5

I am still afraid to switch from Bash to Zsh, because these are things I don't fully understand and will find it hard to debug if _something_ breaks. Is something like this available for bash?

It's puzzling to me that people still think of zsh as "that newfangled shell I'm not sure about yet".

Bash came out in 1989. Zsh came out in 1990.

Re: Zsh-autoquoter makes shell quoting slightly less annoying

#6
post #5

I am still afraid to switch from Bash to Zsh, because these are things I don't fully understand and will find it hard to debug if _something_ breaks. Is something like this available for bash?

It's puzzling to me that people still think of zsh as "that newfangled shell I'm not sure about yet". Bash came out in 1989. Zsh came out in 1990.

i use zsh, but i often invoke bash just to make sure some behavior is "normal" rather than zsh-specific, or specific to how i wrote my .zshrc last decade [and haven't changed].

i don't think it's about the newfangledness; i think it's about the potential for subtle differences in syntax which scare people away from zsh.

Re: Zsh-autoquoter makes shell quoting slightly less annoying

#7
post #3

The shell quoting rabbithole goes pretty deep, especially when you want to preserve the whitespace within arguments. Has this been solved generally yet? I suspect it requires full knowledge of whatever shell is running on the other side of SSH.

It is part of the reason why I use fish whenever possible.

Re: Zsh-autoquoter makes shell quoting slightly less annoying

#8
post #3

The shell quoting rabbithole goes pretty deep, especially when you want to preserve the whitespace within arguments. Has this been solved generally yet? I suspect it requires full knowledge of whatever shell is running on the other side of SSH.

Just thinking of one of OP's examples, his (very cool) autoquoter allows him to type:

> ssh user@host awk '{print $1}' file.txt

And have the "$1" quoted or escaped so that it's interpreted as an awk keyword on the remote system. But what if I actually want it interpreted as a shell variable that should be expanded on the local or remote system? How does it know?

Why is shell quoting still so hard?

Re: Zsh-autoquoter makes shell quoting slightly less annoying

#9

I am still afraid to switch from Bash to Zsh, because these are things I don't fully understand and will find it hard to debug if _something_ breaks. Is something like this available for bash?

Write your scripts using bash or sh in the hashbang and use zsh for your daily work. Also, use shellcheck.
Post reply on HN