Friday, November 10, 2017

zsh - the Z Shell

After years using Bash, and doing more Bash scripting than I ever wanted in the last 2½ years, yesterday I switched to Zsh.

Why? Just because. I got it as my default shell in one remote host, and then decided to install it locally and take the opportunity to learn something new.

I'll be searching a lot for "how do I do X in zsh?"

The interesting things I did today already:
  1. Setup prezto; what seems to be a (better?) alternative to the famous "oh-my-zsh"
  2. Answered an StackOverflow question about zsh! How can I pause in zsh?
  3. Figured out how to get the path to the directory containing the current script: ${${(%):-%N}:h} ${${(%):-%x}:h:a}
    Update Nov/14:
    • Using %x instead of %N makes it work within a function;
    • :a makes the path absolute.

As the last item shows, there is some man zsh going on instead of man bash now.