ZSH

Zsh is a shell designed for interactive use, although it is also a powerful scripting language. - zsh.org

Links


Articles on ZSH

Fast Hostname Completion with ZSH

Credit goes to this post for this: http://nion.modprobe.de/blog/archives/521-hostname-completion-with-zsh.html

In your ~/.zshrc

local knownhosts
knownhosts=( ${${${${(f)"$(<$HOME/.ssh/known_hosts)"}:#[0-9]*}%%\ *}%%,*} )
zstyle ':completion:*:(ssh|scp|sftp):*' hosts $knownhosts

In your ~/.ssh/config

HashKnownHosts no

Minimum Version Checking with BASH/ZSH

Thanks to @retr0h:

[[ $(zsh --version | awk '{print $2}') > 4.3.17 ]]

# usage

if [[ $(zsh --version | awk '{print $2}') > 4.3.17 ]]; then
    # do someting that only higher zsh versions support
else
    # do something else for low versions
fi

This was my origitional (not so sexy solution).

The following line will print zsh version information if the version is greater then or equal to 4.3.17, otherwise it will return blank:

zsh --version | awk '{print $2}' | awk -F'.' ' ( $1 > 4 || ( $1 == 4 && $2 > 3 ) || ( $1 == 4 && $2 == 3 && $3 >= 17 ) ) '

An example usage would be something like:

#!/usr/bin/env bash
if test "$( zsh --version | awk '{print $2}' | awk -F'.' ' ( $1 > 4 || ( $1 == 4 && $2 > 3 ) || ( $1 == 4 && $2 == 3 && $3 >= 17 ) ) ' )"
then
    # do someting that only higher zsh versions support
else
    # do something else for low versions
fi