in reply to At process job id

`at` sends things like 'at>' prompts, '<EOT>' tags and the closing banner to STDERR, which you can capture and run through a regexp:
# format: job 4 at 2001-12-24 14:00 my ($job_id,$job_date,$job_time) = (/job (\d+) at (\S+) (\S+)/);

Replies are listed 'Best First'.
Re: Re: At process job id
by smartybob (Initiate) on Dec 25, 2001 at 00:21 UTC
    hi, however, i dun really get you. if that is the command to run, how about my file. i need to execute the command and at the same time track the job id. I hope it gives you a better idea. Thanxs
      Then here is a full working example:
      # file an `at` job of running contents of 'file' at 12:05 open AT, "at -f test 1205 2>&1 |" || die "can't `at`"; while(<AT>) { ($job_id,$job_date,$job_time) = (/^job (\d+) at (\S+) (\S+)/); + } # last one seen wins print "at job ID: $job_id\n";
        i had tried the above method recommended. However, when i run the code with the output append to a file. This doesn't work. the $job_id simply return a empty field. Why? Pls.. help..
        hey, i had tried the above command in my perl script. however, it doesn't give me the value i want. instead, it return an empty values for all the 3 fields. WHY ?