>The zd-mtx excitement continues...

No kidding :-).

>My solution is just to use "grep -w" instead of "grep" in the appropriate
>places.  ...

How about we do this "the shell way" and get rid of grep and awk
altogether?

I don't know the format of the "labelfile" (where is it documented?),
but on the assumption the tape label is in column 1 and the barcode in
column 2, try the following loop (I tested by searching /etc/services
for "amanda"):

#!/bin/sh

labelfile=/etc/services
tapelabel=amanda

set x `while read tag bar junk
do
    if [ $tag = $tapelabel ]
    then
        echo $tag $bar
        break
    fi
done < $labelfile`
shift

echo "includedtag is <$1>"
echo "includedbar is <$2>"

exit 0

>       - A

John R. Jackson, Technical Software Specialist, [EMAIL PROTECTED]

Reply via email to