- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ksh error "parameter not set"
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
09-07-2000 04:42 AM
09-07-2000 04:42 AM
I want to run it in the current shell.
How do I get past the error message as shown below. I have included the script and the output.
TIA
>cat tmap
if [ "${PROTOCOL_name}" = "" ]
then
echo enter protocol name
read PROTOCOL_name
fi
>. tmap
ksh: PROTOCOL_name: parameter not set
>
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2000 04:50 AM
09-07-2000 04:50 AM
Re: ksh error "parameter not set"
That is a very good question. Tried running it myself, works fine. Cant recreate your error no matter what I do. Try this command and let us know the output;
/sbin/sh -x ./tmap
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2000 04:55 AM
09-07-2000 04:55 AM
Solutionset +u
at the beginning of your script to prevent it from complaining about the use of undeclared variables.
Or you could simply assign a value to PROTOCOL before using it.
PROTOCOL=""
The latter is better programming practise as having the shell fail if you use an undeclared variable is useful for picking up typos in your script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2000 05:02 AM
09-07-2000 05:02 AM
Re: ksh error "parameter not set"
You couldn't recreate it because your shell was already ignoring undeclared variables.
Set -u is normally called in the user's .profile script.
Regards,
John
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2000 05:03 AM
09-07-2000 05:03 AM
Re: ksh error "parameter not set"
If you have
set -u for the ksh then you will get the exact error.
Try adding a set +u
before you check for the if condition.
For more info do a man on ksh and look for all set options.
Hope it helps.
Vikas
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2000 05:16 AM
09-07-2000 05:16 AM
Re: ksh error "parameter not set"
Add the following line as the first one in your script:
#!/usr/bin/sh
When you execute this script, the variable will be set, and the script does not ask for input, until you delete the variable with 'unset'.
Gert Leerdam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2000 05:27 AM
09-07-2000 05:27 AM
Re: ksh error "parameter not set"
I needed to know if the script had been executed before within the same session so I could do some housekeeping items. I just did not want the user to get the error message.
Thanks again.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-07-2000 05:31 AM
09-07-2000 05:31 AM
Re: ksh error "parameter not set"
Maybe your best bet for that is to export readonly variable the first time that you run it. This will be available to any subsequent shell and cannot be unset or changed.
readonly FLAG="set"
export FLAG
Regards,
John