diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-10-05 21:57:32 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-10-05 21:57:32 +0200 |
commit | 9d85e9009c62f1edc6ec5daaee0e07fe3c9a02e2 (patch) | |
tree | c21fd3d3c309255684e1b45cef5fb1a55cfc065c | |
parent | e9aec353ce8807b204b95638d6f5a50d65706dbe (diff) |
bash: Use more idiomatic bash syntax
-rw-r--r-- | .bashrc | 13 |
1 files changed, 7 insertions, 6 deletions
@@ -4,12 +4,13 @@ [[ $- != *i* ]] && return [[ -f /etc/bashrc ]] && . /etc/bashrc -jr() { - local dir - dir=`find "$REPODIR" -maxdepth 2 -path "$REPODIR/*/*" -printf '%P\n' \ - | sort -r \ - | fzf -q "$1"` - [ -n "$dir" ] && cd "$REPODIR/$dir" +function jr { + local dir=` + find "$REPODIR" -maxdepth 2 -path "$REPODIR/*/*" -printf '%P\n' \ + | sort -r \ + | fzf -q "$1" + ` + [[ -n "$dir" ]] && cd "$REPODIR/$dir" } export BROWSER="firefox" |