I am getting the output like this:
ps -ef | grep xyz | grep -v grep | grep -v ruby | awk '{print $8}'
as xyz
but when I am assign this value to the variable and print the variable then I am getting some weird output like this-
string='ps -ef | grep xyz | grep -v grep | grep -v ruby | awk '{print $8}''
echo $string
Output:
output= sudo sh sh xyz
How can I just get the output as xyz