fish shell

Als Plugin Manager kann fundle oder fisher verwendet werden.

Beispiele

anhand uname unterscheiden
# https://github.com/fish-shell/fish-shell/issues/8203#issuecomment-891956454
set -l os (uname)
if test "$os" = Darwin
  # do things for macOS
else if test "$os" = Linux
  # do things for Linux
else
  # do things for other operating systems
end

switch (uname)
  case Darwin
    # do things for macOS
  case Linux
    # do things for Linux
  case '*'
    # do things for other OSs
end

# sollte man nicht machen
test (uname) = Darwin; and # do something for macOS
config in Abhängigkeit von hostname laden
# https://stackoverflow.com/a/48750830/1371731
set -l host_config ~/.config/fish/config.(hostname).fish
test -r ${host_config}; and source ${host_config}