bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unsubstituted variables in "jobs" output


From: Chet Ramey
Subject: Re: Unsubstituted variables in "jobs" output
Date: Mon, 30 Jun 2008 14:23:47 -0400

> Consider the following:
> $ AA=aa; BB=bb; (sleep 10; echo  $AA $BB) & jobs
> [1] 6626
> [1]+  Running                 ( sleep 10; echo $AA $BB ) &
> If there any way tell jobs command to output AA and BB substituted with
> their values?

The variables are expanded in the subshell, not in the parent shell
maintaining the jobs table.  There's no guarantee that the parent shell
and the subshell have the same values for AA and BB.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer

Chet Ramey, ITS, CWRU    address@hidden    http://tiswww.tis.case.edu/~chet/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]