On Sun, Jun 3, 2012 at 11:09 PM, Roland Mainz <[email protected]> wrote:
> On Sun, Jun 3, 2012 at 10:31 PM, Cedric Blancher
> <[email protected]> wrote:
>> On 3 June 2012 22:12, Cedric Blancher <[email protected]> wrote:
>>> The grep builtin in ast-open 20120531 quits when I put it temporarily
>>> into the background with ^Z and then use fg to put it into the
>>> foreground again.
>>>
>>> Example:
>>>
>>> grep -r foo /usr/share/doc
>>> ^Z[1] + Stopped                  grep -r foo /usr/share/doc/
>>> fg
>>> <job quits with any output>
>>>
>>> bg does the same, grep just stops working
>>
>> If I put the grep command in a subshell and then use ^Z the job
>> disappears completely from output of jobs or jobs -l. It's just gone.
>>
>> The only thing which works (per Roland's suggestion) is to use this
>> command chain:
>> (ulimit -c 0 ; grep -r foo /usr/share/man ; true)
>> this can be stopped with ^Z and resumed properly, too.
>
> Mhhh... can "pty" be used to test this in an automated way ? AFAIK we
> had similar issues (e.g. backgrounded "tail" or "tail -f" not working
> or not working properly... and wrapping them into a non-|fork()|ing
> subshell generated more issues while a |fork()|ing subshell worked
> properly) with "tail" in the past...

More test results:
If I suspend grep -r foobar /usr/share/man via ^Z the real cwd (tested
via external utility /bin/pwd) is some random location within
/usr/share/man/ ...

Another two items which need to be checked: What happens if the
builtin utility does something to the signals or opens extra fds ...
and then gets stopped ?

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [email protected]
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)

_______________________________________________
ast-developers mailing list
[email protected]
https://mailman.research.att.com/mailman/listinfo/ast-developers

Reply via email to