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.
 
Do I presume you know precisely what the script is going to want in terms of answers 100% of the time, or is it something more vague where an answer is needed depending on preceding conditions?

Any chance of seeing what you've got to do- I'm surprised you can't just add what you need to do as command parameters.

-Leezer-
 
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 :)
 
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 :)

Glad it worked out :) Expect's manual gives me headaches sometimes but it's a very usefull tool. (Autoexpect gets me out of bother occasionally to)

~S
 
Back
Top Bottom