Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

df -k script exluding mntpnts in lsvg -l rootvg 1

Status
Not open for further replies.

imb4u2

IS-IT--Management
Oct 29, 2004
2
US
looking to create o/p file of df -k excluding all mountpoints associated with rootvg. i would like to append to the file an lspv and only include the disk with a "none" status. this disk space is allocated to the server but not currently being used. thank you for any assistance you can offer...
 
Something like this?

df -k $(lsvg|\
grep -v rootvg|\
lsvg -il|\
egrep ' jfs .*open| jfs2 .*open'|\
awk '{print $1}')

lspv|grep -i none

HTH,

p5wizard
 
I'm telling.... P5 used grep..... twice

Mike

Unix *is* user friendly. It's just selective about who its friends are.
 
That's coz there's an lsvg -il in between.

But I agree, the 2nd grep could be handled by the awk also...

I think I got away with it - perhaps the UUoG Police officer is on holiday [smile]


HTH,

p5wizard
 
Thank you for your response, extremely helpful, trying to understand the nuances of egrep vs grep, also had to change {1} to {7} because the ls -il died without the /dev portion of the descriptor so i changed it to the fs name. i like the format; instead of just one line you continue to newline after every major command - nice tip thank you again.
 
Yes, that shows clearly the different commands and it is also a handy way to keep scripts inside the 80-char width...


HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top