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