diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2019-07-17 16:59:26 +0200 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2019-07-17 16:59:26 +0200 |
commit | c2f72222bb24f5d38d9036fb3034a471c1a6d7cc (patch) | |
tree | 7b6c94c762f371a30d99a33465c96d90a372adae /selectPathFzf.sh | |
parent | 15dc956844ffb5300a47a77f6be8178007430462 (diff) | |
download | scripts-c2f72222bb24f5d38d9036fb3034a471c1a6d7cc.tar.gz scripts-c2f72222bb24f5d38d9036fb3034a471c1a6d7cc.zip |
Created script to use .paths file with fzf.
Diffstat (limited to 'selectPathFzf.sh')
-rwxr-xr-x | selectPathFzf.sh | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/selectPathFzf.sh b/selectPathFzf.sh new file mode 100755 index 0000000..bfe77ad --- /dev/null +++ b/selectPathFzf.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +# Reads a paths file and uses fzf to echo a path. +# An argument is optional and is used as prompt. A default prompt is used if not provided. + +paths="$HOME/.paths" +[ -z "$1" ] && prompt="Choose a path: " || prompt="$1" +fzf --prompt "$prompt" <"$paths" | awk '{print $3}' + |