Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

When I run the command for i in *.log; do cat "$i" | sort; done | more, the pipeline gets a SIGTTIN signal and is stopped.

bash$ for i in *.log; do cat "$i" | sort; done | more
### (one screenful of output...)
--More--
### (press Space)
[1]+  Stopped                 for i in *.log;
do
    cat "$i" | sort;
done | more
bash$ echo $?
149     # indicates SIGTTIN(21)

(I substituted a simple cat for a more elaborate and complex awk script.)

I don't see why a SIGTTIN is generated, as no process reads from tty, except more, which is not in the background. Can someone explain what's going on here?

share|improve this question
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.