On 10/17/2011 12:39 PM, Mike Wright wrote: > Hi all, > > I'm trying to write a bash script and having problems. > > If I execute this: > > ps x | grep mongod | wc -l > > it returns a value. > > OTOH, if I execute this: > > LINES = ps x | grep mongod | wc -l > > it returns "command not found". > > How does one assign the output of a command to an environment variable? > > TIA, > Mike Wright You can use: LINES=`ps x | grep mongod | wc -l` (using back ticks to bracket the command) Emmett -- users mailing list users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe or change subscription options: https://admin.fedoraproject.org/mailman/listinfo/users Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines