I have a bash script that returns a list, which is what I want, but I need to put the results in a variable so I can operate on them one at a time in a for loop.
#!/bin/bash
processID="ps aux | grep `date +"%b"` | gawk '{print \$2}'"
eval $processID
How do I assign the result of eval to a variable? Thanks
pid=$( ps aux | grep `date +"%b"` | awk '{print $2}' )
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With