I am trying to return the result of multiple commands into a single output line. The issue is it seems to output the commands on top of each other, only when the variables are commands.
Provider=$(adb shell getprop gsm.operator.alpha)
Model=$(adb shell getprop ro.product.model)
echo $pM + " is connected"
echo $c " its pretty outside."
Lines in the output of
adb shell commands are terminated by
\r\n, so you have to remove the
There are many ways of doing it, here you are one (and some other corrections):
Provider=$(adb shell getprop gsm.operator.alpha | tr -d \\r) Model=$(adb shell getprop ro.product.model | tr -d \\r) pM="$Provider $Model" echo $pM " is connected"