I've recently switched to zsh mainly for its auto-completion. However, zsh has syntax for scripting different from bash, and I use a lot of ad-hoc one-liners. For example, echo 'qwe\tasd'
expands the \t
to tab in zsh but not in bash. I want to keep all the bash syntax while using zsh's auto-completions.
I've tried adding emulate -LR bash
to my .zshrc
. However, it seems to break some of my zsh tools, namely zsh-autocomplete and starship.
How can I keep my bash syntax while using zsh?
bash
'secho
expands\t
as well at least in some builds or some environments. See thexpg_echo
option inbash
and thebsdecho
option inzsh
. See also Why is printf better than echo?emulate bash
oremulate anything-that-starts-with-b
emulatessh
or the Bourne shell.emulate ksh
will give you a closer equivalent asbash
is mostly a Korn-like shell. See also emulate bash in zsh breaking dynamically assigned file descriptor