From 85d1ee1391c2db812a2b8238b6959c884148da90 Mon Sep 17 00:00:00 2001 From: David JULIEN Date: Sat, 12 Jun 2021 19:21:54 +0200 Subject: [PATCH] fix: bibshow tests + output --- .local/bin/bibshow | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.local/bin/bibshow b/.local/bin/bibshow index 5386f00..d55caac 100755 --- a/.local/bin/bibshow +++ b/.local/bin/bibshow @@ -13,12 +13,12 @@ file="$(find $HOME/documents/bibliographies/ -type f -not -path '*/\.*' | dmenu -l 20 -p "[bibshow] which bibliography?")" # the -not -path allows find to ignore hidden files refs_list="$(sed -e 's/\t//g' "$file" | tr '\n' ' ' | sed -e 's/}\s\s/}\n/g')" -[ -z $refs_list ] && exit 1; +[ -z "$refs_list" ] && exit 1; ref="$(printf "$refs_list" | dmenu -i -p 'reference?' -l 10)" -[ -z $ref ] && exit 1; +[ -z "$ref" ] && exit 1; output="$(printf "$ref" | sed -e 's/author/\n author/g' -e 's/",/",\n/g')" printf "$output" | dmenu -i -p "infos" -l 10 -printf "$ref" | awk -F '{' '{print $2}' | awk -F ',' '{print $1}' | xclip -selection clipboard +printf "$ref" | awk -F '{' '{print $2}' | awk -F ',' '{print $1}' | tr -d '\n' | xclip -selection clipboard