Skip to content Skip to sidebar Skip to footer

Adb Shell Script To Send At Commands To A Modem-cannot Return Control To A Shell And Capture Output

I already posted similar question, but still could not get my job done, so this a a second attempt, where I would like to more clearly state my stumbling block. So basically I am i

Solution 1:

I suggest that you try out my atinout program which should be exactly what you are asking for: a program to send AT commands from the command line and capture the output.

In your case the result should be like

$ echo'at+cops?' | atinout - /dev/pts/7 -
+COPS: 0,0,"AT&T",6

OK
$

and to capture the output just put a file name instead of the last -.

Solution 2:

I had similar problems with redirecting output to file. I resolved my problem by adding CMD /c in front of the echo command. I.e. if I understand correctly you need to tell the system that it needs to wait until command finishes executing and only then redirect output to a file. I was doing it in DOS.

Since you are running on ANDROID try adding sh -c in front of your command. Hope it helps.

Post a Comment for "Adb Shell Script To Send At Commands To A Modem-cannot Return Control To A Shell And Capture Output"