- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: Value interpretation issue
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
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
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
тАО08-03-2006 01:39 AM
тАО08-03-2006 01:39 AM
omnidb -filesystem hostname.domain:/boot 'hostname.domain [/boot]'
However, trying to use variables to handle a loop from a list of these parameters like:
while read SYSNAME
do
omnidb -filesystem ${SYSNAME}
done < /omni/fni/bin/ob_fs_list_tst.txt
omnidb gives a usage synopsis so the value of the variable is not being interpretted in the same way as the explicit command above is even though the command looks the same (and can be copy/pasted to a command line and run successfully). I'm guessing it has something to do with the single quote around the last part of the string that is causing the issue, but we aren't seeing exactly how or how to get around it. Anyone with sharper eyes and brains this morning care to enlighten us?
BTW, each line of the txt file looks like this:
hostname.domain:/ 'hostname.domain [/]'
Jeff Traigle
Solved! Go to Solution.
- Tags:
- while loop
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2006 01:48 AM
тАО08-03-2006 01:48 AM
Re: Value interpretation issue
something like this:
hostname.domain:/ \'hostname.domain [/]\'
or what about quoting your variable
omnidb -filesystem "${SYSNAME}"
- Tags:
- quoting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2006 01:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2006 02:00 AM
тАО08-03-2006 02:00 AM
Re: Value interpretation issue
Dumping the commands to a separate temporary script as Peter mentioned worked. Not quite as "clean" as we were going for, but, if it works, it works. :)
Jeff Traigle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-03-2006 12:03 PM
тАО08-03-2006 12:03 PM
Re: Value interpretation issue
omnidb -filesystem hostname.domain:/boot 'hostname.domain [/boot]'
When the shell sees the single quotes, it removes them and passes everything in them as one parm to omnidb.
If omnidb needs them as one parm, you will have to use eval on $SYSNAME to get the quote working the right way?
Doing the read is like
$ X="hhh.ddd:/ 'hhh.ddd [/boot]'"
Trying to pass that to a command and get the quoted string parsed properly is an issue.
$ printenv $X
the count is 4
hhh.ddd:/
'hhh.ddd
[/boot]'
$ printenv "$X"
the count is 2
hhh.ddd:/ 'hhh.ddd [/boot]'
And I assume you want this:
$ printenv hhh.ddd:/ 'hhh.ddd [/boot]'
the count is 3
hhh.ddd:/
hhh.ddd [/boot]
The only solution I see it to rewrite your file like:
hhh.ddd:/|hhh.ddd [/boot]
And change the read to:
$ IFS="|" read PARM1 PARM2
Then $PARM1 and $PARM2 can be passed to omnidb.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-07-2006 04:06 AM
тАО08-07-2006 04:06 AM
Re: Value interpretation issue
Jeff Traigle