; author: CI/CD % test, ci/cd # escape code + subshell echo -ne "\033]0;$(hostname)\007" # env var echo "$HOME" # multi + column myfn() { for i in $@; do echo -e "arg: $i\n" done } folders=($(echo "")) myfn "${folders[@]}" # second column: default delimiter echo " is cool" # second column: custom delimiter echo " is cool" # return multiple results: single words echo "I like these languages: "$(printf '%s' "" | tr '\n' ',' | sed 's/,/, /g')"" # return multiple results: multiple words echo "I like these examples: "$(printf '%s' "" | sed 's/^..*$/"&"/' | awk 1 ORS=', ' | sed 's/, $//')"" # multiple replacements -> "foo" echo " " # with preview cat "" # with map echo "" # empty echo "http://google.com?q=" # fzf ls / | fzf # echo description space # echo description blank # x echo description one character # map can be used to expand into multiple arguments for l in ; do echo "line: $l"; done # x echo # Concatenate pdf files files=($(echo "")) echo pdftk "${files[@]:-}" cat output $ files: echo 'file1.pdf file2.pdf file3.pdf' | tr ' ' '\n' --- --multi --fzf-overrides '--tac' $ x: echo '1 2 3' | tr ' ' '\n' $ y: echo 'a b c' | tr ' ' '\n' $ z: echo 'foo bar' | tr ' ' '\n' $ table_elem: echo -e '0 rust rust-lang.org\n1 clojure clojure.org' --- --column 2 $ table_elem2: echo -e '0;rust;rust-lang.org\n1;clojure;clojure.org' --- --column 2 --delimiter ';' $ multi_col: ls -la | awk '{print $1, $9}' --- --column 2 --delimiter '\s' --multi $ langs: echo 'clojure rust javascript' | tr ' ' '\n' --- --multi $ mapped: echo 'true false' | tr ' ' '\n' --- --map "grep -q t && echo 1 || echo 0" $ examples: echo -e 'foo bar\nlorem ipsum\ndolor sit' --- --multi $ multiword: echo -e 'foo bar\nlorem ipsum\ndolor sit\nbaz'i $ file: ls . --- --preview 'cat {}' --preview-window 'right:50%' $ phrases: echo -e "foo bar\nlorem ipsum\ndolor sit" --- --multi --map "navi fn map::expand" $ with_overrides: echo -e "foo bar\nlorem ipsum\ndolor sit" --- --fzf-overrides "--margin=15% --bind=ctrl-u:replace-query" # this should be displayed echo hi % # Without tag echo hi 1 2 3