Re: FVWM: Re: Re: question about backgrounds

From: Mikhael Goikhman <migo_at_homemail.com>
Date: Fri, 11 Jul 2003 20:43:18 +0300

On 10 Jul 2003 17:17:27 -0400, parv wrote:
>
> in message <20030710030401.GA20245_at_unixcab.org>,
> wrote Mikhael Goikhman thusly...
> >
> > On 09 Jul 2003 22:40:58 -0400, parv wrote:
> > >
> > > In ~/.xinitrc, try sleeping for a while before starting aterm...
> > >
> > > xv -quit -root <image> && sleep 2
> > > aterm
> >
> > The idea is ok, but the example lines are incorrect. As it is
> > written (running xv in foreground) it wastes 2 sec for nothing.
>
> Why, sleep only if xv succeeds before starting aterm?
>
> I gathered from OP that aterm was starting before xv could do its
> thing. So there should be some reasonable wait before aterm starts.
> (See below before replying to this point.)

This is a non principal discussion, but xv does not reforks itself to
background from foreground, so if xv is finished no futher wait is ever
needed. At least "xv -quit" is transient, so this first problem is not
critical, but aterm is not, so a more important (second) problem in these
lines is a missing ampersand after aterm.

> > This would be more correct:
> >
> > (xv -quit -root <image> && aterm) &
>
> If for some reason, xv fails there would be /no/ aterm. This would
> be the least "correct" thing to do.
>
>
> > xv -quit -root <image> &
> > (sleep 3 && aterm) &
>
> I like this much better than the above two versions for above
> mentioned reasons.
>
>
> Going off topic now...
>
> I would change the last line to either of...
>
> sleep 3 && aterm &
> { sleep 3; aterm; } &
>
>
> ...Why start a sub shell, unless it is a shell specific workaround?

The subshell syntax is portable. As for the last 2 lines, different
shells do different things. The second line most certainly starts a new
shell if this syntax is supported at all. Even the first line starts a
new shell in some shells (bash, tcsh, but not zsh).

Regards,
Mikhael.
--
Visit the official FVWM web page at <URL: http://www.fvwm.org/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_fvwm.org.
To report problems, send mail to fvwm-owner_at_fvwm.org.
Received on Fri Jul 11 2003 - 12:45:16 BST

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:55 BST