- When using
test -n <string>
to test whether a variable is set, do remember double quote the variable name!!! This form is right:test -n "$arg"
, and the following one always return true:test -n $arg
; buttest -z <string>
do not act in this manner, you can omit the quotes around the variable name when using-z
to test whether a string's length is 0.
Some useful fish scripts
- git shortcuts
- simple project switcher
- navigate faster in fish
- quick open and switch to temporary dir
- quick open dolphin file manager in terminal
- quick launch a http server, python needed
- quick edit common used configurations
- quick edit README
- quick edit
.gitignore
file - quick edit a script
- set proxy server
- test a program, with some reminder text before it