send "if [ `ps -ef | grep ttyS1 | sed -n 1p | cut -d ' ' -f 2` -eq 'ttyS1' ]; then
not_found='false'
else
not_found='true'
fi\r"
I have tried so many time with double quote and single quote also under ttyS1 but it is showing 1) ttyS1: unknown operand 2) Bad Number for double quote
You use -eq
which is for comparing numbers. Your =
when you compare strings
send "if [ `ps -ef | grep ttyS1 | sed -n 1p | cut -d ' ' -f 2` = 'ttyS1' ]; then
not_found='false'
else
not_found='true'
fi\r"
And you can use double quotes as they are used already. You can also leave string ttyS1
w/o any quotes
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments