- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Simple script question...
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
12-04-2006 06:14 PM
12-04-2006 06:14 PM
mylog=`hpvmstatus -P scottk_1 | grep scsi`
A typical output from "hpvmstatus -P scottk_1 | grep scsi" gives me the following...
disk scsi 0 0 0 0 0 disk /dev/rdsk/c6t10d0
dvd scsi 0 0 0 1 0 file /tmp/Win2003Server_Itanium-withSP1-AX2EIVOL_EN.iso
disk scsi 0 0 0 2 0 disk /dev/rdsk/c6t10d1
Why does it look like this...
disk scsi 0 0 0 0 0 disk /dev/rdsk/c6t10d0 dvd scsi 0 0 0 1 0 file /tmp/Win2003Server_Itanium-withSP1-AX2EIVOL_EN.iso disk scsi 0 0 0 2
0 disk /dev/rdsk/c6t10d1
when I assign the output to a variable?
I want to keep the formatting and append it after I make a change to the VM's configuration of the disks.
How do I do that?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2006 06:24 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2006 06:38 PM
12-04-2006 06:38 PM
Re: Simple script question...
I was afraid you'd say that......lol
I guess I'll log to a file instead of build the log into a variable then write it to a text file.
Thanks for your help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2006 06:40 PM
12-04-2006 06:40 PM
Re: Simple script question...
Try setting IFS to newline before e.g. echoing it:
# mylog=`hpvmstatus -P scottk_1 | grep scsi`
# IFS=\
+
# echo $mylog
rgds
HGH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2006 06:46 PM
12-04-2006 06:46 PM
Re: Simple script question...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-04-2006 09:17 PM
12-04-2006 09:17 PM
Re: Simple script question...
the assignment to the variable does NOT change the formatting! It is the way you do your output.
Formatting preserved:
print "$mylog"
Formatting ignored:
print $mylog
mfG Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-05-2006 03:31 AM
12-05-2006 03:31 AM
Re: Simple script question...
Points awarded.
Thanks