Code for parsing a key/value in in file from shell script

if HereIsAKey is unique in your file, try this with grep:

myVar=$(grep -Po "(?<=^HereIsAKey ).*" file)

Leave a Comment