From 1d116a3ebd8a3a19e2e7831d620a3f22a6b3bd4e Mon Sep 17 00:00:00 2001 From: krisdoodle45 <86745210+krisdoodle45@users.noreply.github.com> Date: Sun, 12 Sep 2021 21:46:48 +0200 Subject: [PATCH] Use sed instead of awk --- .config/lf/lfrc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.config/lf/lfrc b/.config/lf/lfrc index d1b1a6d2..8da0359a 100644 --- a/.config/lf/lfrc +++ b/.config/lf/lfrc @@ -52,7 +52,7 @@ cmd moveto ${{ clear; tput cup $(($(tput lines)/3)); tput bold set -f clear; echo "Move to where?" - dest="$(awk '{ gsub(/#.*/, ""); } !/^$/ { print }' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed "s/.* //")" && + dest="$(sed "s/#.*//g ; /^$/d" ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed "s/.* //")" && for x in $fx; do eval mv -iv \"$x\" \"$dest\" done && @@ -63,7 +63,7 @@ cmd copyto ${{ clear; tput cup $(($(tput lines)/3)); tput bold set -f clear; echo "Copy to where?" - dest="$(awk '{ gsub(/#.*/, ""); } !/^$/ { print }' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed "s/.* //")" && + dest="$(sed "s/#.*//g ; /^$/d" ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed "s/.* //")" && for x in $fx; do eval cp -ivr \"$x\" \"$dest\" done && @@ -75,7 +75,7 @@ cmd bulkrename $vidir # Bindings map $lf -remote "send $id select '$(fzf)'" -map J $lf -remote "send $id cd $(awk '{ gsub(/#.*/, ""); } !/^$/ { print }' ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed "s/.* // ; s/.*\$HOME/\$HOME/ ; s/}//" | envsubst)" +map J $lf -remote "send $id cd $(sed "s/#.*//g ; /^$/d" ${XDG_CONFIG_HOME:-$HOME/.config}/shell/bm-dirs | fzf | sed "s/.* // ; s/.*\$HOME/\$HOME/ ; s/}//" | envsubst)" map gh map g top map D delete