Andrew Farnsworth wrote: > On Fri, May 22, 2009 at 9:58 AM, Don Delp <[email protected] > <mailto:[email protected]>> wrote: > > > On Fri, May 22, 2009 at 8:50 AM, Alex Smith (K4RNT) > <[email protected] <mailto:[email protected]>> wrote: > > > > That may be because Ctrl-D issues a "logout" command, not an exit. > > > > I'm not sure how the shell interprets a Ctrl-D anyway... I'm not > > *that* familiar with shells. > > > > On Fri, May 22, 2009 at 8:35 AM, Andrew Farnsworth > <[email protected] <mailto:[email protected]>> wrote: > >> Interesting thing to note... logging out of a tty using Ctrl-D > does not > >> register in the .bash_history file (yes, it updates the file > with all the > >> "live" history from that tty), however, if you actually type > "exit" is > >> updates the .bash_history file with the "live" history AND it > includes the > >> exit command. Since I almost always use Ctrl-D to logout, it > means that my > >> earlier suggestion of /bin/bash ~/.bash_history is very > dangerous where if I > >> had typed exit every time I logout, it does nothing but run > everything up to > >> the first exit command in the history file. Still dangerous, > but not nearly > >> as dangerous as logging out using Ctrl-D > >> > >> Curious... > >> > >> Andy > >> > >> > > >> > > > > > > > > -- > > " ' With the first link, the chain is forged. The first speech > > censured, the first thought forbidden, the first freedom denied, > > chains us all irrevocably.' Those words were uttered by Judge Aaron > > Satie as wisdom and warning... The first time any man's freedom is > > trodden on we’re all damaged." - Jean-Luc Picard, quoting Judge > Aaron > > Satie, Star Trek: TNG episode "The Drumhead" > > - Alex Smith (K4RNT) > > - Nashville, Tennessee USA > > > > > > > > > I'm pretty sure Ctrl+D means End Of File to the shell. > > The logout command appears in the .bash_history file as well, so I am > going with the EOF to the shell. My understanding is that the console device driver interprets the Ctrl+D as EOF, so the shell never actually sees the Ctrl+D character. It only sees that the device driver has returned the EOF status. The result is the same as if the shell were reading a series of commands from a disk file, and reached the end of the file.
-- John F. Eldredge -- [email protected] PGP key available from http://pgp.mit.edu "Reserve your right to think, for even to think wrongly is better than not to think at all." -- Hypatia of Alexandria --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "NLUG" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nlug-talk?hl=en -~----------~----~----~----~------~----~------~--~---
