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?
$value
in place of$1
in thegrep
command. – chepner Jul 15 '13 at 13:46grep
. – ojhawkins Jul 15 '13 at 13:59