- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- how to perform exact match with the awk.
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
05-24-2006 05:53 PM
05-24-2006 05:53 PM
I want to remove the some VxVM volumes.
sliam16:/ # vxprint -v
Disk group: dg
TY NAME ASSOC KSTATE LENGTH PLOFFS STATE TUTIL0 PUTIL0
v vol1 fsgen ENABLED 3145728 - ACTIVE - -
v vol2 fsgen ENABLED 3145728 - ACTIVE - -
v vol3 fsgen ENABLED 4096000 - ACTIVE - -
v vol4 raid5 ENABLED 3584000 - ACTIVE - -
v vol5 fsgen ENABLED 806912 - ACTIVE - -
v vol6 fsgen ENABLED 1048576 - ACTIVE - -
v vol6-L01 fsgen ENABLED 1048576 - ACTIVE - -
v vol7 fsgen ENABLED 409600 - ACTIVE - -
v vol7-L08 fsgen ENABLED 58560 - ACTIVE - -
v vol7-L09 fsgen ENABLED 58560 - ACTIVE - -
v vol7-L10 fsgen ENABLED 58560 - ACTIVE - -
v vol7-L11 fsgen ENABLED 58560 - ACTIVE - -
v vol7-L12 fsgen ENABLED 58560 - ACTIVE - -
v vol7-L13 fsgen ENABLED 58560 - ACTIVE - -
v vol7-L14 fsgen ENABLED 58560 - ACTIVE - -
v vol8 fsgen ENABLED 409600 - ACTIVE - -
v vol9 fsgen ENABLED 1843200 - ACTIVE - -
v vol9-L08 fsgen ENABLED 263360 - ACTIVE - -
v vol9-L09 fsgen ENABLED 263360 - ACTIVE - -
v vol9-L10 fsgen ENABLED 263360 - ACTIVE - -
v vol9-L11 fsgen ENABLED 263360 - ACTIVE - -
v vol9-L12 fsgen ENABLED 263360 - ACTIVE - -
v vol9-L13 fsgen ENABLED 263360 - ACTIVE - -
v vol9-L14 fsgen ENABLED 263360 - ACTIVE - -
v vol10 fsgen ENABLED 1843200 - ACTIVE - -
I wan to remove all the volumes of the format vol1 to vol10.
I know this can be done with a for loop. But, I want to do it with the one line command something like this.
vxprint -v | awk '/vol[expression to match no]/ {print $2}' | xargs -n1 vxedit -g dg -rf rm
How could i write a rule with the awk?
I just want to match vol1 to vol10, how could i do it?
Thanks & regards,
Prasad.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2006 07:58 PM
05-24-2006 07:58 PM
Re: how to perform exact match with the awk.
This can be done with a single line but somtimes its better to do it command for each volume to have more control and may be its less time consuming compared to testing a script/single line command and any bugs that command line may have.
e.g. you post shows the vol6 , vol7 , vol8 as probably some layered volumes - I am not an expert in Veritas VM. so you need not remove the vol7-L08 and so on I guess.
So if this is one time activity why not use command line for every volume.
This is just my view.
Regards,
Ninad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2006 08:24 PM
05-24-2006 08:24 PM
Re: how to perform exact match with the awk.
You are right vol7-L** and vol9-L** need not be removed explicittly. Actully, when I remove vol7 (vol9) they will get removed atuomatiacally.
So I just want way to remove all of them in one shot, using on line command.
Thanks for your help.
I have seen you posting replies to many questions. I think you are maharastrian. I am from Pune. Where are you from? (If you have any problems you need not answer.)
Thanks & regards,
Prasad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2006 08:32 PM
05-24-2006 08:32 PM
Re: how to perform exact match with the awk.
vxprint -v | grep '^v' | awk '{print $2}' | grep -v "-" | xargs -n1 vxedit -g dg -rf rm
But make sure you have unmounted the filesystems using these volumes.
I am from Pune as well.
Mail me at ninaddate at indiatimes.com or rediffmail.com
Regards,
Ninad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-24-2006 08:55 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2006 02:45 AM
05-25-2006 02:45 AM
Re: how to perform exact match with the awk.
vxprint -v | awk '$2~/-L..$/{print $2}' | xargs -n1 vxedit -g dg -rf rm
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2006 05:45 AM
05-25-2006 05:45 AM
Re: how to perform exact match with the awk.
# vxprint -v | sed -n 's/.* \(vol[0-9]*\) .*/\1/p' | xargs -n1 vxedit -g dg -rf rm
cheers!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2006 07:49 AM
05-25-2006 07:49 AM
Re: how to perform exact match with the awk.
vxprint -v |awk '$2 ~ "^vol1$" || $2 ~ "^vol10$"'|while read list
do
remove the filesystems
done
You get the idea..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-25-2006 05:35 PM
05-25-2006 05:35 PM
Re: how to perform exact match with the awk.
Thanks for providing me with different ways of doing the same thing.
Thanks & regards,
Prasad