Skip to content

Instantly share code, notes, and snippets.

@Nek
Created March 21, 2018 10:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Nek/8c1d9055ac234a7bae3329e546b9de9f to your computer and use it in GitHub Desktop.
Save Nek/8c1d9055ac234a7bae3329e546b9de9f to your computer and use it in GitHub Desktop.
Bash to Fish
setting variables
bash: var=value
fish: set var value
function arguments
bash: "$@"
fish: $argv
function local variables
bash: local var
fish: set -l var
conditionals I
bash: [[ ... ]] and [ ... ]
fish: test ...
conditionals II
bash: if cond; then cmds; fi
fish: if cond; cmds; end
conditionals III
bash: cmd1 && cmd2
fish: cmd1; and cmd2
command substitution
bash: output=$(pipeline)
fish: set output (pipeline)
process substitution
bash: join <(sort file1) <(sort file2)
fish: join (sort file1 | psub) (sort file2 | psub)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment