On 1/2/20 8:45 AM, Wheatley, Martin R wrote: > It appears that there may be an issue when bash terminates a shell as a > result of TMOUT expiring. > > I was attempting to enter "dc_command show media | grep YD" to the shell and > this is the terminal output... > > OLDuser@hostname $ dc_command show mediatimed out waiting for input: > auto-logout > NEWuser@hostname $ | grep YD > -bash: syntax error near unexpected token `|'
I don't know what you have TMOUT set to, but it seems kind of small from that example. > If the command line had been something like " cd fred && rm -rf *" > and the TMOUT had expired just after the '&&' had been entered then the > "rm-rf *" would have been executed in the `cwd` of the parent process rather > than in 'fred' Yes. Since a child and its parent process share file descriptors (and file pointers), terminal input not consumed by the child is available for the parent. > > It looks like the TMOUT isn't re-started after any shell input but only after > a '\n' is seen. That's how it's documented: TMOUT is the number of seconds to wait for "a line of input after issuing the primary prompt." It issues the prompt and waits for a complete line of input. That way it can work whether or not you're using readline. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU c...@case.edu http://tiswww.cwru.edu/~chet/