[Pdx-pm] job control
todd_caine at eli.net
Sun Jun 1 21:38:17 CDT 2003
perl -e 'print `/usr/bin/bash jobs`'
On (Sun, Jun 01 18:15), Randall Hansen wrote:
> Folks ~
> I'm trying to get a list of bash's suspended jobs using Perl. I
> initially thought this would be trivial (e.g. perl -e "print exec
> jobs"), but I've yet to succeed. I tried permutations of "system,"
> "exec," backticks, etc. The closest I've come is: $ perl -e "print
> `jobs`" which apparently does an eval on the output of jobs (causing
> errors and yielding nothing useful). But what I really want is to
> capture and examine the output, not echo it.
> It occurs to me (after seeing "No such file ..." a few times) that
> technically jobs is a builtin of bash, not a system command. This
> hasn't gotten me any closer. I can start a new bash with perl, but
> can't figure out how to send builtins to an existing one.
> Which in turn makes me think that this may be more of a bash question
> than a Perl one, but I thought I'd ask anyway.
More information about the Pdx-pm-list