I am having trouble piping the output of the "at" command to my program.
it seems that it would work just like any function, but for some reason it does not output the info to STDOUT.
ie.
this works well..
##################
open(ATQ, "atq|"
while(<ATQ>)
{
print $_;
}
##################
but..
###################
open(AT, "at -f commands 00:00 12/12/01 |" #"commands" is the file with the commands so that the program does not need to be interactive
while(<AT>) #says that it's already closed
{
print $_; #prints nothing
}
###################
does not. The output, which is supposedly should have been in the $_ variable is just outputed into the console as if I just opened the command without piping.
i.e "job 40 00:00 2001-12-12 a" or something of that sort
if anyone has an idea of why it would do that and how to go around the problem, I would be very greatfull.
it seems that it would work just like any function, but for some reason it does not output the info to STDOUT.
ie.
this works well..
##################
open(ATQ, "atq|"
while(<ATQ>)
{
print $_;
}
##################
but..
###################
open(AT, "at -f commands 00:00 12/12/01 |" #"commands" is the file with the commands so that the program does not need to be interactive
while(<AT>) #says that it's already closed
{
print $_; #prints nothing
}
###################
does not. The output, which is supposedly should have been in the $_ variable is just outputed into the console as if I just opened the command without piping.
i.e "job 40 00:00 2001-12-12 a" or something of that sort
if anyone has an idea of why it would do that and how to go around the problem, I would be very greatfull.