I\'d like to create a script that greps for a specific string in a log file that is being written to. I\'d like to take the first result and put that into a variable for lat
> $var doesn't do what you think it does.
It redirects the output of the preceding command to a file with name of what $var contains.
To capture the output of a command and put it into a variable, use variableName="$(...)".