Register
It is currently Sun Apr 22, 2018 9:52 pm

filter list


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Mon Apr 16, 2018 2:45 am   

Joined: Wed Feb 28, 2018 4:29 am
Posts: 4
Hello

i have i list like:

# zpool list -H -o name,cap |grep -v rpool
db101dtm 24%
db101iam 24%
db101osb 24%
db103apo 24%
db901dtm_arch 1%
db901dtm_ofa 37%
db901dtm_ora 65%
db901dtm_redo 28%
db901iam_arch 0%
db901iam_ofa 4%
db901iam_ora 21%
db901iam_redo 28%
db901osb_arch 16%
db901osb_ofa 0%
db901osb_ora 37%
db901osb_redo 14%
db902apo_arch 0%
db902apo_ofa 0%
db902apo_ora 7%
db902apo_redo 28%

i want filter a pool only whit % < 20 how can do?

tnx


Top
 Profile  
 PostPosted: Mon Apr 16, 2018 10:30 pm   

Joined: Mon Oct 20, 2014 9:53 am
Posts: 574
Code:
zpool list -H -o name,cap | grep -v rpool | awk -F'[ %]' '{this=$(NF-1);if (this < 20) print this}'


Top
 Profile  
 PostPosted: Wed Apr 18, 2018 2:38 pm   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 642
Code:
zpool list -H -o name,cap | awk -F'[ %]' '$0!~"rpool"{this=$(NF-1);if (this < 20) print this}'
no need for grep.


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Google [Bot] and 26 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP