LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   slackware 14.0: how is user input to console terminated (EOT)? Ctrl-D used to work. (https://www.linuxquestions.org/questions/slackware-14/slackware-14-0-how-is-user-input-to-console-terminated-eot-ctrl-d-used-to-work-4175523152/)

stf92 10-23-2014 01:28 PM

slackware 14.0: how is user input to console terminated (EOT)? Ctrl-D used to work.
 
What's said.

genss 10-23-2014 01:36 PM

bash won't acknowledge it if there are characters on the line

stf92 10-23-2014 01:46 PM

What about linux programs that take input from console? The buffer must be first emptied by the program?

Didier Spaier 10-23-2014 01:54 PM

Ctrl-C then Ctrl-D

That should first kill any process in the foreground controlled by that console/tty/pty.

Of course you can type Ctrl-z then "bg" if want to keep the process running.

stf92 10-23-2014 01:59 PM

I see that is the case. "tr '\n' ' '" is immediately exits when typing ^D because it reads manual input very rapidly.

stf92 10-23-2014 02:01 PM

Quote:

Originally Posted by Didier Spaier (Post 5258448)
Ctrl-C then Ctrl-D

That should first kill any process in the foreground controlled by that console/tty/pty.

Of course you can type Ctrl-z then "bg" if want to keep the process running.

But I did not want to send any signal in case of sendmail being the command in question. sendmail does not process the input and I lie there waiting not able to diagnose.

genss 10-23-2014 02:03 PM

Quote:

Originally Posted by stf92 (Post 5258447)
What about linux programs that take input from console? The buffer must be first emptied by the program?

well.. depending on if the program uses a canonical or non-canonical mode on the stdin file

ctrl-d is EOF/EOT
so if you press is on an empty line, the next read() that program does will be of length 0

i think in non-canonical mode the EOF character (0x4) will be passed to the program

stf92 10-23-2014 02:09 PM

I like to know what the behavior is for sendmail. Going back the title matter: in slackware 12.0 ^D irrevocably ended user console input. It never failed to terminate input.

Alien Bob 10-23-2014 03:39 PM

Instead of asking vague questions, tell us exactly what command is not accepting your Ctrl-D in Slackware 14.0 when it was working in earlier versions.

Or perhaps for your user account on this computer you have set ignoreeof? Then you need to enter Ctrl-D 10 times before it gets accepted by the shell.
(enabling ignoreeof is achieved by adding this to your .bashrc or .profile: "set -o ignoreeof")

Eric

stf92 10-23-2014 05:45 PM

Code:

bill@server:~$ set|grep ignoreeof
bill@server:~$

As to the vague questions... err, no, ^D, I only know I used to accidentally strike some keys and I recovered normal kb use with ^D while ^C had no effect in 12.0. Exactly the reverse is true in 14.0. See that fingers have a very precise memory, but cannot remember and exact command name.


All times are GMT -5. The time now is 05:51 PM.