Solved

problem ! is not accepted in HP-UX machine

Posted on 2007-11-28
6
590 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

Background Still having to process all these year-end "csv" files received from all these sources (including Government entities), sometimes we have the need to examine the contents due to data error, etc... As a "Unix" shop, our only readily …
Recently, an awarded photographer, Selina De Maeyer (http://www.selinademaeyer.com/), completed a photo shoot of a beautiful event (http://www.sintjacobantwerpen.be/verslag-en-fotoreportage-van-de-sacramentsprocessie-door-antwerpen#thumbnails) in An…
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

627 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