Solved

problem ! is not accepted in HP-UX machine

Posted on 2007-11-28
6
570 Views
Last Modified: 2013-12-26
Hi guys i am facing this problem..and it work for Sun box...do you have any idea??

what to do..

test.ksh
if ! "$PVT_OPT_S" || ! "$PVT_OPT_G"
if ! [[ -d "$PVT_SRCLOC" ]]

output:

/tmp/test.ksh[253]: !:  not found
/tmp/test.ksh[325]: !:  not found
0
Comment
Question by:parlepoint
6 Comments
 
LVL 40

Expert Comment

by:omarfarid
ID: 20367178
Hi,

Are you sure that you are not running it as a csh / tcsh?

0
 

Author Comment

by:parlepoint
ID: 20367247
i am sure running as ksh
0
 
LVL 40

Expert Comment

by:omarfarid
ID: 20367264
Hi,

If you run from the command line

$ ksh
$ if ! [[ -f /etc ]]
then
echo not file
fi

What do you get? Is the same error?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:parlepoint
ID: 20367719
not same error
$ if ! [[ -f /etc ]]
> then
> echo hello
> fi
ksh: !:  not found
0
 
LVL 48

Accepted Solution

by:
Tintin earned 50 total points
ID: 20368074
Solaris and HP-UX have different ksh versions.

The normal way of writing the test is:

if  [[ ! -d "$PVT_SRCLOC" ]]

if  [[ -n "$PVT_OPT_S" -o  -n  "$PVT_OPT_G" ]]
0
 
LVL 51

Expert Comment

by:ahoffmann
ID: 20393093
which ksh version are you using?
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The following is a collection of cases for strange behaviour when using advanced techniques in DOS batch files. You should have some basic experience in batch "programming", as I'm assuming some knowledge and not further explain the basics. For some…
Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

919 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now