- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: unix scripting - understanding read_param
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
Forums
Discussions
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
03-26-2007 11:39 PM
03-26-2007 11:39 PM
unix scripting - understanding read_param
My boss has asked me to look at it and understand it as I may soon have to support it. I've done some shell scripting in the past so I'm not a novice; having said that I'm no expert either.
The script makes use of something called 'read_param'. My question is this : what is read_param and where is it defined ? By putting set -x at the start of the script I can see that it does what it says on the tin i.e. it reads a parameter. I can see that it reads the value of LOGHOME (for example) as /var/alexbkup. Fair enough, but I've looked until I'm blue in the face to find where read_param is defined. This is where I've looked so far :
Is it a unix command ?
/etc/profile
$HOME/.profile
aliases
$HOME/.kshrc
Variables within the script
Functions within the script
I can't see it defined anywhere. My guess is I'm missing something really obvious. If any of you guys can help I'd be most appreciative. Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2007 11:46 PM
03-26-2007 11:46 PM
Re: unix scripting - understanding read_param
there seem to be some sort of eval equivalent going on.
Search in your PATH:
"/bin:/usr/bin:/usr/local/bin:/opt/backups/bin"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-26-2007 11:51 PM
03-26-2007 11:51 PM
Re: unix scripting - understanding read_param
Your 'read_param' is an external script or binary that returns a value to the calling script.
For example:
LIMIT=$(read_param FS_THRESHOLD)
...set the value of LIMIT to whatever 'read_param' makes it based on the key FS_THRESHOLD.
It would be clearer and much cleaner (security-wise) if the references were made with an absolute path rather than relying on "." being in the user's path.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2007 01:26 AM
03-27-2007 01:26 AM
Re: unix scripting - understanding read_param
since '.' is NOT in the PATH set by the script:
export PATH="/bin:/usr/bin:/usr/local/bin:/opt/backups/bin"
... and is not a std-command either, you'll have to look into
/usr/local/bin
/opt/backups/bin
for file called 'read_param'.
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2007 02:00 AM
03-27-2007 02:00 AM
Re: unix scripting - understanding read_param
> Peter N. wrote: since '.' is NOT in the PATH set by the script:
Yes, I totally missed the fact the script sets its own PATH as opposed to inheriting it. In fact, this is good technique. Examine the directories Peter noted for the 'read_param' entity.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2007 02:38 AM
03-27-2007 02:38 AM
Re: unix scripting - understanding read_param
I want a kick up the behind for not spotting this myself. read_param was simply a script in /opt/backups/bin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-27-2007 04:35 PM
03-27-2007 04:35 PM
Re: unix scripting - understanding read_param
If you do a "whence -v", it will tell you what the shell thinks it is.