Operating System - HP-UX
1753261 Members
4997 Online
108792 Solutions
New Discussion

==: A test command parameter is not valid

 
p7
Frequent Advisor

==: A test command parameter is not valid

hi all

 

im getting this in a script from a vendor, they re looking into it.

in the meantime i was curious, what does that error means if the

script is checking for the OS:

 

if [ "`uname`" == "OS400" ]
then

 

it sees that its hp-ux but then gets the error mssg in the subject

 

thx in advance

 

1 REPLY 1

Re: ==: A test command parameter is not valid

What shell (if any) is referenced at the start of the script?

 

e.g.

 

#!/usr/bin/sh

#!/usr/bin/ksh

#!/usr/bin/csh

#!/usr/local/bin/bash

 

Which on HP-UX at least would be the POSIX shell, Korn shell, C Shell or GNU bash shell (if installed)

 

The [ xxx == yyy ] construct is bash shell syntax if I recall corerctly... if the vendor is trying to be portable, one would imagine he would use POSIX standards, which implies using:

 

if [ "`uname`" = "OS400" ]

 

which has the advantage of working in POSIX, Korn and bash shells...

 

 


I am an HPE Employee
Accept or Kudo