I am writing a bash script that will execute the command and store the value in a string variable, now I need to split the string after certain characters. Is there any way? I cannot use delimiters because the format is similar to this
PV Name /dev/sda2
PV Size 10.39 GB
Here I need to get / dev / sda 2 and 10.39 GB (if possible, only 10.39) and write it to a new file. I cannot use a separator because space is first. I have not done many bash scripts. Is there any way to do this?
source
share