From 103a60106ee297f225c4d6ff775362bd0699468d Mon Sep 17 00:00:00 2001 From: Reto Kromer Date: Tue, 22 Jan 2019 17:43:13 +0100 Subject: [PATCH] fix barcode extraction (#190) * fix barcode extraction --- mountlto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mountlto b/mountlto index 2fbd627..53f5300 100755 --- a/mountlto +++ b/mountlto @@ -50,7 +50,7 @@ for i in $(seq 1 "${LTO_COUNT}") ; do let COUNTER=COUNTER+1 ltfs -f -o devname="${DECK}" 2> "${LOADTMP}" # find barcode by either "Volser(Barcode)" (Quantum style) or "Tape attribute: Barcode" (IBM style) - TAPE_SERIAL=$(cat "${LOADTMP}" | grep -a "Volser(Barcode)\|Tape attribute: Barcode" | awk 'NF>1{print $NF}') + TAPE_SERIAL=$(cat "${LOADTMP}" | grep -o "Volser(Barcode).*\|Tape attribute: Barcode.*" | grep -Eo "\b[A-Z0-9]{6}\b|\b[A-Z0-9]{8}\b") echo -n "." done echo