twintriode
Technical User
Hello all,
I have been looking for the last hour or two on information on how to pass commands onto a normal program that would normally take input from a bash command line.
How can I run the program from perl and enter the predefined info into the input fields automatically.
I have tried:
#!/usr/bin/perl -w
print "doing it now\n";
open(MAIL, "| /sbin/nokia_ctl gsm sendSMS");
print MAIL "Heres some email for you\n";
print MAIL "+61411666888\n";
print MAIL "+6421600601\n";
close(MAIL);
print "DONE\n";
but this does not seem to work. It just prints the standard output from nokia_ctl but does not pass any input to the program.
I just get:
# ./test1
doing it now
Please type the message (max 160 chars)
Please type the receiver number
Please type the SMS center number
DONE
Sorry if I have not made myself clear but it is 03:54 and I am a little tired.
Thanks in advance
I have been looking for the last hour or two on information on how to pass commands onto a normal program that would normally take input from a bash command line.
How can I run the program from perl and enter the predefined info into the input fields automatically.
I have tried:
#!/usr/bin/perl -w
print "doing it now\n";
open(MAIL, "| /sbin/nokia_ctl gsm sendSMS");
print MAIL "Heres some email for you\n";
print MAIL "+61411666888\n";
print MAIL "+6421600601\n";
close(MAIL);
print "DONE\n";
but this does not seem to work. It just prints the standard output from nokia_ctl but does not pass any input to the program.
I just get:
# ./test1
doing it now
Please type the message (max 160 chars)
Please type the receiver number
Please type the SMS center number
DONE
Sorry if I have not made myself clear but it is 03:54 and I am a little tired.
Thanks in advance