Thursday, 27 October 2011

Batch scripting error after Linux conversion

Batch scripting error after Linux conversion

Hello,

We are in the process of converting from HP Unix to Linux (bash), and one of our shell scripts is giving an error on the first line of the code below.

Code:

if [ ! -f ${FILENAM}* ]

then
 error_out "${FILENAM} is not found" 1 $LINENO
fi

Where FILENAM is the first script parameter.

Here is the error we're getting:

Quote:

line 42: [: too many arguments
Do you know how the if-clause needs to be rewritten to avoid the error? I tried searching online, but have not found a satisfactory solution.

Thank you,
Art

No comments:

Post a Comment