summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2019-10-19 21:24:28 +0200
committerErich Eckner <git@eckner.net>2019-10-19 21:24:28 +0200
commit3b94c7504d2b6927b081e3dd58e854a7a1224345 (patch)
tree58ca3633d1b04d09347765e7a534e5de0a3d762a
parentc04187f4f98eaa4485ae5154dde17c3ec5af3619 (diff)
downloadSchraubendatenbank-3b94c7504d2b6927b081e3dd58e854a7a1224345.tar.xz
Inventur: frag_aus_Tabelle_ab() repariert
-rwxr-xr-xInventur12
1 files 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() {