diff options
| author | Tim J. Robbins <tjr@FreeBSD.org> | 2002-05-19 07:27:26 +0000 |
|---|---|---|
| committer | Tim J. Robbins <tjr@FreeBSD.org> | 2002-05-19 07:27:26 +0000 |
| commit | addcdbb29fb90e5b356674a4f1e156ea32188de3 (patch) | |
| tree | 5e70023eefd89555e17ff5b38f3a72c44f816e10 /bin | |
| parent | 0f29e702c982f23e29e26bbe3e013381adca3aa0 (diff) | |
Notes
Diffstat (limited to 'bin')
| -rw-r--r-- | bin/sh/jobs.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/bin/sh/jobs.c b/bin/sh/jobs.c index b1cc2de5768b9..54d596b27fd22 100644 --- a/bin/sh/jobs.c +++ b/bin/sh/jobs.c @@ -203,6 +203,9 @@ fgcmd(int argc __unused, char **argv) jp = getjob(argv[1]); if (jp->jobctl == 0) error("job not created under job control"); + out1str(jp->ps[0].cmd); + out1c('\n'); + flushout(&output); pgrp = jp->ps[0].pid; #ifdef OLD_TTY_DRIVER ioctl(2, TIOCSPGRP, (char *)&pgrp); @@ -220,13 +223,20 @@ fgcmd(int argc __unused, char **argv) int bgcmd(int argc, char **argv) { + char s[64]; struct job *jp; do { jp = getjob(*++argv); if (jp->jobctl == 0) error("job not created under job control"); + if (jp->state == JOBDONE) + continue; restartjob(jp); + fmtstr(s, 64, "[%d] ", jp - jobtab + 1); + out1str(s); + out1str(jp->ps[0].cmd); + out1c('\n'); } while (--argc > 1); return 0; } |
