Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

problem ! is not accepted in HP-UX machine

Posted on 2007-11-28
6
Medium Priority
?
594 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: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

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 150 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

This Windows batch file is useful for organizing image files from a digital camera or other source, but can have many other uses.  It simply renames the file(s) to match their create date.  For example, if you took a picture today at 1:40pm and the …
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…
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…

715 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