awk - How to isolate logical volume group UDID for shell script? -


i looking use "diskutil cs list" show logical volume groups. need able isolate udid.

example line "diskutil cs list"

+-- logical volume group b848bcc7-6ffa-4643-afe1-56fca333a6b5 

previously though process to;

diskutil cs list | grep 'group' 

i think awk better route show string of letters , numbers. have been unsuccessful in finding out how dow so

ultimately, use udid in shell script reformatting fusion drive. using similar below.

set (do shell script "diskutil cs list|grep 'group'") 

i'd set udid , not full line.

try:

diskutil cs list | awk '/group/{print $nf}' 
  • /group/ lines have word group in them. filter mechanism. if output lines have group in them, can remove /group/ part.
  • once finds lines, print last element of line. awk default splits line on space.

Comments

Popular posts from this blog

c++ - How to add Crypto++ library to Qt project -

jQuery Mobile app not scrolling in Firefox -

How to use vim as editor in Matlab GUI -