Amanda-Users

Re: don't understand amverify

2003-08-28 15:45:45
Subject: Re: don't understand amverify
From: lance dillon <ldillon AT sk-tech DOT com>
To: amanda-users AT amanda DOT org
Date: Thu, 28 Aug 2003 14:32:59 -0500
On Thu, 2003-08-28 at 14:28, Kurt Yoder wrote:
> So I'm trying to get amverify to verify "nttar" and "gtar" backups.
> I've looked at this part of the amverify script from amanda 2.4.2p2:
> 
> if [ X"$1" = X"program" -a X"$2" != X"" ]; then
>       if [ X"$TAR" != X"" -a X"$2" = X"$TAR" ]; then
>               CMD=$TAR
>               ARGS="tf -"
>       elif [ X"$TAR" != X"" \
>               -a X"$SAMBA_CLIENT" != X"" \
>               -a X"$2" = X"$SAMBA_CLIENT" ]; then
>               CMD=$TAR
>               ARGS="tf -"
>       elif [ X"$TAR" != X"" \
>               -a X`basename $2` = X`basename $TAR` ]; then
>               CMD=$TAR
>               ARGS="tf -"
> 
> But I don't understand it. If $1 is "tar", oes X"$1" = X"program"
> compare "Xtar" to "Xprogram"? What are all these X's for?

Shell doesn't like empty strings, so the X guarantees that the strings
will not be empty on either side of the comparison.  It still comes out
the same.  Xtar = Xtar is that same as tar = tar, but it prevents tar =
"", by turning it to Xtar = X.


Attachment: signature.asc
Description: This is a digitally signed message part

<Prev in Thread] Current Thread [Next in Thread>