Post

shell

Bash

  • Bash test framework: https://github.com/sstephenson/bats

Zsh

Parameter expansion

Zsh does not do word splitting. For example, this is what happens in zsh

1
2
3
$ export DYDB="aws dynamodb --endpoint-url http://localhost:8081"
$ $DYDB list-tables
zsh: no such file or directory: aws dynamodb --endpoint-url http://localhost:8081

There are two ways to make it compatible with bash:

  1. Use ${=variable}
  2. setopt shwordsplit

See zsh FAQ.

ZLE

ZLE is the line editor in Zsh. readline is the line editor in bash. so .inputrc in bash cannot be used in zsh. We need to use bindkey builtin to define these key bindings.

This post is licensed under CC BY 4.0 by the author.