This question already has an answer here:

I know how to set a BASH variable equal to the output from a command, but it doesn't work in case of 'top' command for me, see below

cat aTOPFWK.sh
OUTPUT = $(top -b -n 1 | egrep 'fwk3' |  awk '{print $9}')
echo "${OUTPUT}"
./aTOPFWK.sh: line 3: OUTPUT: command not found
share|improve this question

marked as duplicate by terdon bash Nov 26 '15 at 17:45

This question was marked as an exact duplicate of an existing question.

get rid of the blanks around the "=":

OUTPUT=$(top -b -n 1 | egrep 'fwk3' |  awk '{print $9}')
echo "${OUTPUT}"
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.