• 0 Posts
  • 3 Comments
Joined 7 days ago
cake
Cake day: March 13th, 2025

help-circle
  • mina86@lemmy.wtftoLinux@lemmy.mlLinux Terminal: CTRL+D is like pressing ENTER
    link
    fedilink
    English
    arrow-up
    15
    arrow-down
    2
    ·
    edit-2
    11 hours ago

    It’s not. You keep insisting that ^D doesn’t send EOF and yet:

    $ stty -a | grep eof
    intr = ^C; quit = ^\; erase = ^?; kill = ^U; eof = ^D; eol = <undef>;
    $ man stty |grep -A1 eof |head -n2
           eof CHAR
                  CHAR will send an end of file (terminate the input)
    

    ^D is the EOF character. The thing is that in C every line of a text file must be terminated by a new-line. And so, when you end a file with ^D without a return, you get funky results.