ZSH tips

Posted on 2018-10-09 in Trucs et astuces • Tagged with ZSH, Shell, Linux

Sommaire

ZBell

Useful to have a notification when a long command completes.

To enable it, add zbell to your plugins array if you are using oh-my-zsh or source the definition file.

To configure:

  • The minimum time commands must take for the notification to happen, use: ZBELL_DURATION. For instance ZBELL_DURATION …

Continue reading

Bash tricks

Posted on 2018-10-03 in Trucs et astuces • Tagged with Bash, Shell, Linux

Sommaire

Scripts

Use this at the top of all your Bash scripts to avoid problems:

# Exit on error.
set -e
# Don't allow undefined variable.
set -u
# Make pipeline fail if any command in it fail.
set -o pipefail