Quote:
Originally Posted by hnasr2001
If I run the following two lines, the rsult will be 3;
myteststring1="radmon radmon radmon"
echo $myteststring1 | grep -o radmon | wc -l
How to store the result in a variable?
Thanks
|
Code:
VARIABLE=$(echo $myteststring1 | grep -o radmon | wc -l)
Seems less than elegant. ;(
But it's all you gave me to work with.