Store output in variable & use variable in command

view story

http://stackoverflow.com – I am trying to run a command and store it in a variable. length=`last | grep foouser | wc -l` It works fine but when I add a variable to the command it breaks. value=$1 length=`last | grep $value | wc -l` How can I get this second example to work by acceptomg a variable? (HowTos)