Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Functions that start Jobs



Gregory Margo wrote:

> ...
> 
> Why does a function take up a job slot?
> And if it does, why doesn't 'exec' work?

Because no other shell can do this:

  % f() { sleep 10; echo foo }
  % f
  ^Z
  zsh: 4022 suspended  f
  % fg
  [1]  + continued  f
  [ time passes... ]
  foo

Note that it reported that it had stopped the job `f' and that the `foo'
was printed after the `sleep' finished.

With bash:

  $ f() { sleep 10; echo foo; }
  $ f
  ^Z
  [1]+  Stopped               sleep 10
  foo
  $

Ick!


Bye
  Sven


-- 
Sven Wischnowsky                         wischnow@xxxxxxxxxxxxxxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author