- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ksh: !: not found
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-29-2004 01:27 AM
тАО04-29-2004 01:27 AM
ksh: !: not found
I'm having a problem with HP-UX ksh(1) :
The man page for ksh clearly says:
A compound expression can be constructed from these primitives by using any of the following, listed in decreasing order of precedence.
[...]
! expression True if expression is false.
[...]
Nonetheless, hpux's ksh doesn't seem to behave correctly on that point.
I've tried 3 tests on ksh on Solaris 7 and 8 and Linux. On all teh system the behaviour was correct and as expected:
TEST 1:
$ type !
Expected result (right for all OS, except HPUX)
! is a reserved shell keyword
On HP-UX, we get:
! not found
TEST 2:
$ if ! true
then
echo TRUE
else
echo FALSE
fi
Expected result (right for all OS, except HPUX):
FALSE
On HP-UX i get:
ksh: !: not found
FALSE
(Although FALSE is written on the output, it's due to the fact that the if condition fails because ! is not known by this ksh)
TEST 3:
$ if ! false
then
echo TRUE
else
echo FALSE
fi
Expected result (right for all OS, except HPUX):
TRUE
On HP-UX i get:
ksh: !: not found
FALSE
(we get FALSE for te same reason as above).
On this HP-UX host, the ksh version is:
adumont@psup01$ uname -a
HP-UX psup01 B.11.11 U 9000/800 624653342 unlimited-user license
adumont@psup01$ what $( which ksh )
/usr/bin/ksh:
defs.c $Date: 2002/11/18 20:42:15 $Revision: r11.11/2 PATCH_11.11 (PHCO_27019)
edit.c $Date: 2002/11/18 20:43:06 $Revision: r11.11/2 PATCH_11.11 (PHCO_27019)
io.c $Date: 2002/11/18 20:47:57 $Revision: r11.11/3 PATCH_11.11 (PHCO_27019)
cmd.c $Date: 2002/11/18 20:41:14 $Revision: r11.11/1 PATCH_11.11 (PHCO_27019)
main.c $Date: 2002/11/18 20:52:03 $Revision: r11.11/4 PATCH_11.11 (PHCO_27019)
xec.c $Date: 2002/11/18 20:52:56 $Revision: r11.11/2 PATCH_11.11 (PHCO_27019)
macro.c $Date: 2002/11/18 20:51:03 $Revision: r11.11/2 PATCH_11.11 (PHCO_27019)
error.c $Date: 2002/11/18 20:44:16 $Revision: r11.11/2 PATCH_11.11 (PHCO_27019)
jobs.c $Date: 2002/11/18 20:49:04 $Revision: r11.11/2 PATCH_11.11 (PHCO_27019)
$Revision: @(#) all CUP11.11_BL2002_1129_1 PATCH_11.11 PHCO_27019
Fri Nov 29 08:52:39 PST 2002 $
$ B.11.11_LR Feb 8 2002 01:58:34 $
Version 11/16/88
Does someone have any explanation about that ? Or is it simply a ksh bug on HPUX ??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-29-2004 01:34 AM
тАО04-29-2004 01:34 AM
Re: ksh: !: not found
kaps
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-29-2004 01:36 AM
тАО04-29-2004 01:36 AM
Re: ksh: !: not found
Posix shell works
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-29-2004 02:15 AM
тАО04-29-2004 02:15 AM
Re: ksh: !: not found
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-29-2004 10:01 AM
тАО04-29-2004 10:01 AM
Re: ksh: !: not found
I know that sh-posix(1) is a better shell. IMHO, i really like it much more than ksh.
The problem is that i'm trying to write a script that will have to run on any platform (a monitor for OVO).
I'm badly surprised that "!" is not recognized by the hpux's ksh. I think it's a bug.
The only problem i find to sh-posix(1) is that i have only been able to use it on hp-ux. (but not all the systems are hp-ux -- unfortunately ;) ). AFAIK, it's not available under Solaris neither Linux.
I've also tried with [ ! expr ], but it doesn't work correctly neither.
Any other suggestion?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО04-29-2004 10:31 AM
тАО04-29-2004 10:31 AM
Re: ksh: !: not found
my 2 cents
UNIX because I majored in cryptology...