Quantcast
Channel: VMware Communities : All Content - All Communities
Viewing all articles
Browse latest Browse all 176760

Automate Datastore creation with grep, awk, or sed

$
0
0

I am updating my post kickstart to layout my ESX datastore.  This is for my lab environment where I wipe and drop often. I got all of my drives type and label in a simple array

 

PHYSICAL_DRIVES="SATA_SSD-SSD_VM Samsung-SSD_VSAN HITACHI-SSD_HDD"

 

What is the proper syntax or tool (grep, sed, or awk) to read in for example "SATA_SSD-SSD_VM" as $input and break it up into two variable where the market is "-"

So $type = would be "SATA" or all character from the start of $input up to the character "-"

 

and $label = would be "SSD_VM" or all the character after "-" to the end of the $input string

 

And feedback would be appreciated.  Thank you in advance


Viewing all articles
Browse latest Browse all 176760

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>