Amanda-Users

Re: ? mistake sh in amverifyrun 2.4.4p1

2004-02-13 13:01:33
Subject: Re: ? mistake sh in amverifyrun 2.4.4p1
From: Jean-Louis Martineau <martinea AT iro.umontreal DOT ca>
To: amanda-users AT amanda DOT org
Date: Fri, 13 Feb 2004 12:59:14 -0500
On Fri, Feb 13, 2004 at 12:46:08PM -0500, Jon LaBadie wrote:
> On Fri, Feb 13, 2004 at 12:27:23PM -0500, Allen Liu --- work wrote:
> > I am not sure if this is an error in amverifyrun script.
> > 
> > I run amverifyrun and got a error :
> > 
> > test: argument expected.
> > 
> > When I viewed the script I found the 1st line is :
> > 
> >     #!/bin/sh
> > while there is a test line in body :
> >     [ -e ...... ]
> > 
> > This is not supported in sh. After I change 1st line to #!/bin/ksh,
> > it works fine.
> > Has anybody experienced this before ?
> 
> Likely authored by someone working on a system where /bin/sh is
> not Bourne shell, but a posix compatible shell.
> 
> While not as comprehensive as the "does any type of file exist
> by this name", -e option, the test could probably be replaced by:
> 
>    [ -d ... -o -f ... ]
> 
> which only checks for directory or ordinary files.  It doesn't
> consider devices, sockets, named pipes, ... but those are
> pretty uncommon where amanda is probably testing.

Only the -f test is correct, we don't want a directory.

Jean-Louis

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