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
|