Shell script

Patrick McManus mcmanus at AppliedTheory.com
Tue Jun 13 16:26:41 EDT 2000


In a previous episode Anthony J. Gabrielson said...
:: 
:: Hello,
:: 	I have what I hope to be an easy question.  How do I make the
:: output of a command, it will be a number, assign to a variable.  I'm using
:: bash - I have been reading through several books on this and I'm starting
:: to get frusterated.
:: 

I assume you mean output like you said, and not return code..

#!/bin/bash

num=`/bin/grep -c mcmanus /etc/group`
echo mcmanus is in $num groups

-
Subcription/unsubscription/info requests: send e-mail with
"subscribe", "unsubscribe", or "info" on the first line of the
message body to discuss-request at blu.org (Subject line is ignored).



More information about the Discuss mailing list