I have a file that I need to look up a value by key using a shell script. The file looks like:
HereIsAKey This is the value
How can I do so
If you don't have a grep that supports Perl-compatible regular expressions, the following seems to work:
VAR=$(grep "^$KEY " file | cut -d' ' -f2-)