Amanda-Users

Re: ? mistake sh in amverifyrun 2.4.4p1

2004-02-13 12:48:07
Subject: Re: ? mistake sh in amverifyrun 2.4.4p1
From: Jon LaBadie <jon AT jgcomp DOT com>
To: amanda-users AT amanda DOT org
Date: Fri, 13 Feb 2004 12:46:08 -0500
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.

-- 
Jon H. LaBadie                  jon AT jgcomp DOT com
 JG Computing
 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)

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