- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Script help required...
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
02-06-2002 02:30 AM
02-06-2002 02:30 AM
I am trying to automate a process around doing a vgimport on a host... I have my map file, and a list of disks to go in the vg - the list of disks is generated in the order:
c1t0d0
c2t0d0 (alt link)
c1t1d0
c2t1d0 (alt link)
c1t2d0
c2t2d0 (alt link)
c1t3d0
c2t3d0 (alt link)
etc...
However I want the volume group to be created with load balancing down the channels, so when the vgimport occurs, I want the order to be:
c1t0d0
c2t0d0 (alt link)
c2t1d0
c1t1d0 (alt link)
c1t2d0
c2t2d0 (alt link)
c2t3d0
c1t3d0 (alt link)
Now I know the algorithm to do this is -
start
read two lines - write two lines
read two lines - swap order of lines and write
goto start until complete
But I'm struggling to turn this into a shell or awk script...
Any ideas will earn points
Thanks
Duncan
I am an HPE Employee

Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2002 02:40 AM
02-06-2002 02:40 AM
Re: Script help required...
Try using sort:
sort -t"t" -k2 filename
Regards,
Justo.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2002 02:50 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2002 03:04 AM
02-06-2002 03:04 AM
Re: Script help required...
How about:
==================
awk '
BEGIN{a=1}
{l=$0;getline
if (a==1){print l;print}
else
{print;print l}
a*=-1}' file
==================
Rgds, Robin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-06-2002 03:15 AM
02-06-2002 03:15 AM
Re: Script help required...
#!/usr/bin/sh
let FLAG=0
while read DISK
do
read ALTDISK
if (( FLAG & 1 ));
then print "${ALTDISK}"
print "${DISK}"
else print "${DISK}"
print "${ALTDISK}"
fi
let FLAG=FLAG+1
done
}
Regards,
John