Solved

problem ! is not accepted in HP-UX machine

Posted on 2007-11-28
6
585 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
[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

 

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

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

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 …
Over the years I've spent many an hour playing on hardened, DMZ'd servers, with only a sub-set of the usual GNU toy's to keep me company; frequently I've needed to save and send log or data extracts from these server back to my PC, or to others, and…
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…

734 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