From 3b94c7504d2b6927b081e3dd58e854a7a1224345 Mon Sep 17 00:00:00 2001 From: Erich Eckner Date: Sat, 19 Oct 2019 21:24:28 +0200 Subject: Inventur: frag_aus_Tabelle_ab() repariert --- Inventur | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Inventur b/Inventur index 1864fea..a828a25 100755 --- a/Inventur +++ b/Inventur @@ -72,15 +72,13 @@ frag_aus_Tabelle_ab() { printf ' FROM `%s`' "${Kategorien["$1"]}" } \ | mysql -N --raw --batch \ - | tr '\t' ' ' \ - | sort -u + | sort -u \ + | sort -k2,2 ) - Antwort=$( - frag_ab "$1" $(printf '%s\n' "${Alternativen}" | sed 's@^\S\+ @@') + frag_ab "$1" $(printf '%s\n' "${Alternativen}" | sed 's@^\S\+\s@@') \ + | join -1 1 -2 2 -o 2.1 - <( + printf '%s\n' "${Alternativen}" ) - printf '%s\n' "${Alternativen}" \ - | grep -wF "${Antwort}" \ - | cut -d' ' -f1 } zeige_Infos() { -- cgit v1.2.3-70-g09d2