|
|
A question... many times I type Unix, because I want to read news. That works fine...but I can never quit after I finish. I try logout then it says, to try quit so finally I just disconnect the modem. how am I really supposed to do it?
100 responses total.
At the login: prompt, type bye and off you go, bye-bye, it's a process.
At the login prompt, any of the following should userids should execute a program to disconnect the modem: bye exit hangup quit Susan, if you're at a Unix shell prompt the exit command is exit You can also do a control-D from that point.
This response has been erased.
I have been having a problem logging out at my UNIX prompt. It gives me a not in login shell...so I end up going to menu and L. I would like for someone to look at it and maybe get it right...or tell me what to do.. I love learning more. ;) tnx again!
Sounds like somehow you ran a shell from some other program. Try typing "exit" instead of "logout", and see where it gets you.
Or, "quit"?
Find out the process number of that shell and 'kill' it. How about Control-D? Won't that kill a shell (I know it kills a login shell).
Ok..the only suggestion that was made here I didnt try was ^D...maybe that will help me. Thanks again....Yall (southerner ya know) are the best to help ;)
I had that problem, and how I solved it, was that I created a command
that would exit from the shell. I have two, actually. "a" is my logout
and "e" is my exit command.
You have to be running .csh to get away with this, but you would need
to to add
alias e exit
alias a logout
to your .cshrc file. This works very well for me.
Since running MacLayers I usually have to invoke both of these commands
to exit, and with Zterm, only 1 is needed.
Hope that helps you.
This response has been erased.
(Wheels within wheels within wheels...)
omni yeah I amde those alises ...but popcorn was right I was in UNIX shell but not the right one. I got online help and the problem was solved. Thank ya both for responding. Don't know if I would make it thru these times without everyones Grex Wisdom! ;) err..1st line amde = made
That's why I read this conference. Feel free to ask as many questions as you need.
And then there is always the tried and true .... stty 0 which has an immediate effect.
Which is roughly equivalent to the power switch on your modem.
Not if you have an internal modem - in which case the power switch is the power switch for your computer. (**Why** don't they put an external switch on internal modems?)
Good point, Dave. stty 0 is roughly equivalent to unplugging your phone cord.
This response has been erased.
*Another* reason why I don't have a computer with an internal modem.
Good old tried and true ... it even works with a bang if necessary, !stty 0. Might be rude and crude, but so's chopping fire wood with a single-bitted axe.
this looks like a good place to ask this - since "exec stty 0" in a .logout hangs up the phone, but hangs up your internet link if you are on a ttypX, I was told that "stty hupcl" will work, as that means 'hang up on close' according to what I understand. now, what I don't understand, is why it usually doesn't work. I have that in my .logout, but in only one time in 10 or so will I get hung up on. the rest of the time Iwill end up at the login prompt. so, I guess I'd like to know either 1) what I'm doing wrong or 2) a simple one-line "if" structure or something that will do an "exec stty 0" only if I am on a dialup.
any word here ???????
This response has been erased.
Don't know. I always lets grex hang up on me whether I'm telnetting
or dialing in. I just "logout" and let the system do the rest (with
the exception of having to type "bye" at the login prompt when dialing
in). I suppose you could look at a finger output and test whether
you're on an "h" tty or a "p" tty and only do an "stty 0" in the former
case. Something along the lines of "finger -fs mylogin | awk {print $4}"
could be used to pick out the TTY field of the finger output. You'd
use that to set a shell variable and then test if the variable had an
"h" or a "p" or "q" and proceed accordingly. Well...just an idea. I'll
let those shell script wizards make it workable...
The "tty" command tells you what tty you're on.
To simplify matters somehat, a series of exit commands (including at the login: ) works well.
I usually disconnnect after I logout. If I use bye/exit, it confuses my system, and it takes longer to recover. I'm told that a disconnect at that point leaves no running processes in grex.
That's correct -- it should be safe simply to disconnect if you're at the login prompt.
I guess what I liked about the finger output was that it was a bit more concise than tty, but either could be used. (!tty = /dev/ttyp8 !finger -fs |awk = p8) I've been using finger -fs at UM to figure out where I'm telnetting in from, and then am able to make certain assumptions about my terminal and such, so that was my first thought.
well, before I came back to this item, this is what I had come up with for my .logout: echo dam logged out `date` ; if ( `expr $tty : 'ttyh' ` ) exec stty 0 that seems to work.
Question. I am logged on to 2 tty's right now. I lost my connection while using pine, and now that tty is dormant but logged to me. Can I order it to close? Aside from tying up a grex port, Pine doesn't want me to read/write from 2 places at once. It gives me a "read only" convention. Do dormant lines get purged(of course they do, but when?) Sometimes I see people with several logs on the fire simultaneously. Sorry I couldn't find the answer elsewhere, but thought I might get a quicker answer, plus share useful info by asking.
I'm still there after 59 minutes as a door-mat. Hope I don't get mistaken for a staffer! Extra big :). I don't know enough for that!
There has been discussion of reaping inactive ptty's, but no action yet. Such "ghost" pttys don't use any bandwidth, so long as there is no limit on their number. You can kill them yourself, though. Consult man kill (and then, ask how ;-)).
That's what I thought, except for the weird situation with my mail, I might not have asked, but I'm glad I did. Thanks.
Do a 'ps -x' at a Unix prompt (or '!ps -x' from a picospan prompt to find out which processes are yours. Chances are pretty good that the ones that are inactive have a ? under the tty column of the ps output. Those are one you can 'kill'. I'd use 'kill -9 processnumber' (substituting the process number given by ps for "processnumber" for the processes you want to kill). My guess is that if you kill the login shell for that dormant tty, you'll pretty much kill everything connected with it. Watch that you don't kill your current shell.. As an example: /home/kentn> ps -x PID TT STAT TIME COMMAND 850 ? S 0:03 -tcsh (tcsh) 1022 q7 S 0:02 -tcsh (tcsh) 1035 q7 S 0:02 newmail -i 30 3706 q7 R 0:00 ps -x kill -9 850 would do in that abandoned shell.
Good. I can understand that even at 3:20 a.m. when my body function is trying to "kill -9 wakeshell". Thanks. BTW, man kill was hard to follow at first pass without the kind of script just provided, although I *expect* that the protocols were laid out, just beyond my reach at the moment without a little guidance.
I thank you also. I had a more complex instruction, which I was not sure of enough to repeat, so hoped someone would offer a simpler one - and kentn did! The first step I was given was ps uxt<tty>, where tty is the idle tty iden (e.g., ps uxtttyh3, for where I am now). The kill command was then kill -1 <pid>. I'd be glad to be enlightened on the whys and wherefores of the two approaches.
Your ps command asks for info on a particular tty. I wasn't sure we knew right off hand which tty was causing a problem, so the more generic ps -x gives everything your loginid owns, and includes processes without a controlling terminal (and then you have to sort out which tty is a problem). I sometimes use ps -ux, but that gives an output that usually goes off the right hand side of my screen, making it difficult to see what process is being run (long path names for the command cause this). The -u tells ps to put up information about %CPU and %MEM usage, which is pretty much irrelevant to identifying the tty you want to kill. ps -x is a bit narrower and should give the information needed. kill -9 I use just to be sure the process gets killed. -9 means "kill it dead dead dead and then burn the evidence". You might be able to get by with a kill command of lesser severity, but I couldn't be sure and didn't want to beat around the bush here in cf trying to figure out which kill command to use, especially since it was late and I was going to log off. Those are my reasons for giving the commands I did; other commands would also work in most cases. I'll let the Unix gurus explain it in more detail (I just have a layman's understanding which may be technically at fault...but we got the job done anyway :)
Reads like pretty good guru speak to me. Thanks again.
| Last 40 Responses and Response Form. |
|
|
- Backtalk version 1.3.30 - Copyright 1996-2006, Jan Wolter and Steve Weiss