From 9d85e9009c62f1edc6ec5daaee0e07fe3c9a02e2 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 5 Oct 2023 21:57:32 +0200 Subject: bash: Use more idiomatic bash syntax --- .bashrc | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.bashrc b/.bashrc index eb2bf20..0d0c74d 100644 --- a/.bashrc +++ b/.bashrc @@ -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" -- cgit v1.2.3