[Pdx-pm] job control

Randall Hansen randall at sonofhans.net
Mon Jun 2 01:25:34 CDT 2003


Thus spoke "Todd Caine" <todd_caine at eli.net>
( Sun, 1 Jun 2003 19:38:17 -0700 ):

> perl -e 'print `/usr/bin/bash jobs`'

Thanks for the reply, but this doesn't work:
    $ perl -e 'print `/bin/bash jobs`'
    jobs: jobs: No such file or directory

Did it work for you?  What're you running? (Debian, bash 2.05b, perl
5.8 here).

I think the syntax may be wrong anyway.  I think you need a -c to pass
a command to bash:
	$ perl -e 'print `/bin/bash -c ls`'

...works, giving me a listing of the current dir, while:
    $ perl -e 'print `/bin/bash ls`'
    ls: /bin/ls: cannot execute binary file

Finally, this:
    $ perl -e 'print `/bin/bash -c jobs`'

...but it doesn't give me any output at all.  I think that's because
it's passing the 'jobs' command to a new invocation of the shell,
which doesn't inherit the parent shell's jobs.

r

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://mail.pm.org/pipermail/pdx-pm-list/attachments/20030601/57400b37/attachment.bin


More information about the Pdx-pm-list mailing list