I'm trying to grep the command df -h with a pattern that comes from a mysql command. Right now I have something like this:
df -hP | grep $(mysql -uroot -e "select statement")
Right now this is trying to grep the result of the mysql query instead of using the result as the pattern to grep the df result
The result of the mysql statement is "raid_48"
I will then want to pipe this into mailx. Maybe I shouldn't be trying to do this with a one liner
$(mysql -uroot -e "select statement")depending on what it returns it may break grep syntax.grepis trying to processraid_48as a file instead of an expression, try adding-eas also suggested in my answer.