fork/redirecting a (specifically the cu) process?

Caporegime
Joined
18 Oct 2002
Posts
29,493
Location
Back in East London
I'm trying to run an automated script that uses the cu command (call-up)
However, it requires terminal interaction, which is making life difficult.

Is there a way, to perhaps form the cu command, then attach it to something like a dummy terminal and send it string as if I were typing the keys myself on the keyboard.. then fetch the resulting string.
 
I need to open the cu command on a given port, the script will look something like:
Code:
#!/bin/bash
exec 5<cu -e -o -s 115200 -l /dev/ttyUSB0 # this line will obviously fail
echo -en "AT+CIMI\r" > 5
echo "~." > 5
while 0<&5 read line
do
    // blah
done
exit 0
 
It is good, it works great. :)

Though I just need to bring the file systems up before udev handles events on boot, so that it can use my script for the modems :)
 
Back
Top Bottom