Q:

grep to variable

VAR=`command-name`
VAR="`grep word /path/to/file`"
## or ##
 
VAR=$(command-name)
VAR="$(grep word /path/to/file)"
0

New to Communities?

Join the community