[cs631apue] `ls | more` hangs unless stderr is redirected

Jan Schaumann jschauma at stevens.edu
Tue Oct 11 09:00:46 EDT 2016


kthompso <kthompso at stevens.edu> wrote:
> I am having an issue trying to run the ls-test file against my ls 
> implementation.
> It keeps hanging and timing out at this command `./ls 
> ~jschauma/apue/ls-test | more`.
> 
> # ./ls-test
> ./ls ~jschauma/apue/ls-test | more
> timed out
> 
> If I run the command directly from the terminal it acts as expected:

This is due to the timeout(1) utility.  If you pass "--foreground" to
timeout(1) in the ls-test script, then it should work as expected.

I'll have to see how this behaviour changed since last year, since we
didn't run into that problem then.  We'll discuss the details of process
groups and signals that relate to this particular issue in tonight's
class, so in a way that's good timing.

-Jan


More information about the cs631apue mailing list