On Fri, Jul 22, 2005 at 01:50:49PM +0200, Rainer Dorsch wrote:
> Hello,
> 
> I was debugging a larger script, and found that the buildtin jobs command 
> does 
> not work in bash scripts, altough it does in an interactive shell:
> 
> [EMAIL PROTECTED]:~/tmp.nobackup$ cat testjob
> #!/bin/bash
> 
> sleep 35 &
> jobs -p %%
> [EMAIL PROTECTED]:~/tmp.nobackup$ ./testjob
> [EMAIL PROTECTED]:~/tmp.nobackup$ . testjob
> 17825
> [EMAIL PROTECTED]:~/tmp.nobackup$
> 
> It might be a feature, in the man page, I read:
> 
>        The symbols  %%  and
>        %+  refer  to  the shell's notion of the current job, which is the last
>        job stopped while it was in the foreground  or  started  in  the  back-
>        ground.
> 
> ...but I don't read out of that that it does not work in a non-interactive 
> shell.
> 
> I know it worked before in that script and ksh does not make a difference 
> between interactive and non-interactive shell. But I don't know
> 
> Any comments are welcome.

See if 
    set -m
makes any difference.

-- 
William Park <[EMAIL PROTECTED]>, Toronto, Canada
ThinFlash: Linux thin-client on USB key (flash) drive
           http://home.eol.ca/~parkw/thinflash.html
BashDiff: Super Bash shell
          http://freshmeat.net/projects/bashdiff/


_______________________________________________
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash

Reply via email to