HPE GreenLake Administration
- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- script not working
Operating System - HP-UX
1826378
Members
4188
Online
109692
Solutions
Forums
Categories
Company
Local Language
back
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
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
01-24-2005 11:40 PM
01-24-2005 11:40 PM
I have written one script to do some omniback reporting but the script is not running at all no error message and I have to ctrl-c to break it.
abc
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2005 11:52 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2005 12:03 AM
01-25-2005 12:03 AM
Re: script not working
You'll need to trace the execution to find out where the hang occurs, probably in one of the omniback commands. I would suspect any media query commands. But to be sure, add the -x option to all program parts including functions. The way I do this is to add a debug test to the beginning of every function and also to the beginning of the main program:
#!/usr/bin/sh
# To trace this script's operation, set the variable
# DEBUG temporarily as in:
# DEBUG=1 my_script options...
DEBUG=${DEBUG:=NotSet}
[[ $DEBUG = NotSet ]] || set -x
...
function MyFunction
{
DEBUG=${DEBUG:=NotSet}
[[ $DEBUG = NotSet ]] || set -x
...
}
etc...
Repeat the $DEBUG test in every function (in yours: getinfo_std getinfo_lib standalone library). When you run the script normally, the debug statements are inactive. When you run with the temprary variable DEBUG set on the command line (don't set or export DEBUG on a separate line) the script will trace every step onto stderr. If you want to pipe the results to pg or more, be sure to redirect stderr to stdout as in:
DEBUG=1 my_script options 2>&1 | more
For readability, you may want to change all your grave accent (reverse apostrophes) to $(...) as the grave accent construct has been deprecated for many years (see man sh-posix or man ksh). Example:
change: HOST=`hostname`
to: HOST=$(hostname)
Grave accents cannot be nested as in:
MYIP=$(getip $(hostname))
Bill Hassell, sysadmin
#!/usr/bin/sh
# To trace this script's operation, set the variable
# DEBUG temporarily as in:
# DEBUG=1 my_script options...
DEBUG=${DEBUG:=NotSet}
[[ $DEBUG = NotSet ]] || set -x
...
function MyFunction
{
DEBUG=${DEBUG:=NotSet}
[[ $DEBUG = NotSet ]] || set -x
...
}
etc...
Repeat the $DEBUG test in every function (in yours: getinfo_std getinfo_lib standalone library). When you run the script normally, the debug statements are inactive. When you run with the temprary variable DEBUG set on the command line (don't set or export DEBUG on a separate line) the script will trace every step onto stderr. If you want to pipe the results to pg or more, be sure to redirect stderr to stdout as in:
DEBUG=1 my_script options 2>&1 | more
For readability, you may want to change all your grave accent (reverse apostrophes) to $(...) as the grave accent construct has been deprecated for many years (see man sh-posix or man ksh). Example:
change: HOST=`hostname`
to: HOST=$(hostname)
Grave accents cannot be nested as in:
MYIP=$(getip $(hostname))
Bill Hassell, sysadmin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2005 12:27 AM
01-25-2005 12:27 AM
Re: script not working
Hi,
depending on the size/complexity of the script either add debug statements (echo "this is proces...") and/or set +x
set +x output can be a bit confusing, especially in loops.
depending on the size/complexity of the script either add debug statements (echo "this is proces...") and/or set +x
set +x output can be a bit confusing, especially in loops.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
Company
Support
Events and news
Customer resources
© Copyright 2025 Hewlett Packard Enterprise Development LP