- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- perl differences with 11iv2?
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
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
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-14-2005 05:20 AM
04-14-2005 05:20 AM
I'm starting a script with a test for user and OS, like:
chomp($thisuser = `/usr/bin/whoami`);
chomp($thisos = `/usr/bin/uname -r`);
if($thisos ne "B.11.23") {
if($thisuser ne "root") {
print "You need to run this script as root.\n";
exit(0);
}
print "This script runs on HP-UX11.23. \n";
exit(0);
}
These tests work fine on a box running 11.11, but the user test fails to catch a non-root user on an 11.23 box. Both boxes point to the same location for the same version of Perl.
Any idea what I'm doing wrong?
Thanks!
Solved! Go to Solution.
- Tags:
- Perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2005 05:25 AM
04-14-2005 05:25 AM
Re: perl differences with 11iv2?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2005 05:33 AM
04-14-2005 05:33 AM
Re: perl differences with 11iv2?
No, good thought, so I double-checked since I'm a sysadm, but it's as me, with a non-zero uid, that it's happening.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2005 06:21 AM
04-14-2005 06:21 AM
SolutionIf the script you have a problem with is different -- please post that script. :) Otherwise, remove the check for 11.23 or invert the order of the conditionals if you want to test for non-root on 11.23.
i.e.
if($thisuser ne "root") {
print "You need to run this script as root.\n";
exit(0);
}
if($thisos ne "B.11.23"){
print "This script runs on HP-UX 11.23.\n";
exit(0);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-14-2005 06:50 AM
04-14-2005 06:50 AM