From e646fdd9c797e1a1d625ae2dfcc22372a37b63e2 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Fri, 5 Feb 2016 21:01:29 +0100 Subject: passmenu: don't use awk Prof. Aho always seemed neat, but parsing a script inside a script for the simple purpose of removing the trailing new line seems a bit absurd. So, instead use two processes! One for getting the first line and one for removing the trailing line. Everybody loves more calls to fork(), right? --- contrib/dmenu/passmenu | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/contrib/dmenu/passmenu b/contrib/dmenu/passmenu index 9b5239d..c89d9b9 100755 --- a/contrib/dmenu/passmenu +++ b/contrib/dmenu/passmenu @@ -20,7 +20,6 @@ password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@") if [[ $typeit -eq 0 ]]; then pass show -c "$password" 2>/dev/null else - pass show "$password" | - awk 'BEGIN{ORS=""} {print; exit}' | + pass show "$password" | head -n 1 | tr -d '\n\r' | xdotool type --clearmodifiers --file - fi -- cgit v1.2.3-59-g8ed1b