Oh yeah, I wouldn’t use that for scripts. I wouldn’t use zsh for scripts either.
I mean, I believe, it’s generally compatible with bash, but just throwing a shebang like #!/bin/sh or #!/bin/bash into the first line of the script will make it execute with sh or bash, even when you run it from zsh.
Honestly I haven’t tried this on Linux yet, but didn’t Windows implement this somewhere along the way?..
cd ....
I believe,
zsh
supports that.Interesting, I might have to check that out someday.
Though when I write scripts, I’m not a fan of blind folder navigation like that, there’s a good reason for the pushd and popd script commands.
Oh yeah, I wouldn’t use that for scripts. I wouldn’t use
zsh
for scripts either.I mean, I believe, it’s generally compatible with
bash
, but just throwing a shebang like#!/bin/sh
or#!/bin/bash
into the first line of the script will make it execute withsh
orbash
, even when you run it fromzsh
.Windows be like
cd …
ls
grumble grumble
dir
Wanna fix that real quick?
echo @dir %1 %2 %3 %4>%SystemRoot%\System32\ls.bat
I aliased
cd
to a custom funtion in my bashrc to do this at one point, butcd ../../../..
is too engrained so I never rembered to use it.You will probably like zoxide (i am not sure about policy on links here, but here you go https://github.com/ajeetdsouza/zoxide)
Zoxide is nice, or use Yazi so you can actually see where you’re going.
Yazi, Superfile, Midnight Commander (my favorite), or Ranger. I’m sure there’s more, but those are the ones I know.