1

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
irom
  • 483
  • 2
  • 10
  • 20

1 Answers1

1

get rid of the blanks around the "=":

OUTPUT=$(top -b -n 1 | egrep 'fwk3' |  awk '{print $9}')
echo "${OUTPUT}"
Thomas Dickey
  • 76,765