[lkml]   [1998]   [Jul]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Should dot command log me out? Excuse me if it is not a kernel question!
Frank Peng enscribed thusly:

> Appreciate your help:

> See this program named

> #!/bin/sh
> echo $USER
> exit 0

> At the Linux prompt, type .
> It will logout out and ask my login in again.

Yup... That's correct...

> What I am doing is:

> I want to do something in a shell program like this:

> PATH=/tmp/bin:$PATH
> export PATH

> It never worked. I think this only send the variable to his child shell.
> But I want to send it to his sibling shell. So I type .

Take out the "exit 0" at the end. That's what's logging you out.
When you do "." you are telling your current shell to "source" that
file and execute those commands. When you hit the exit command, your current
shell does exactly what it's told, it exits. :-)

Michael H. Warfield | (770) 985-6132 |
(The Mad Wizard) | (770) 925-8248 |
NIC whois: MHW9 | An optimist believes we live in the best of all
PGP Key: 0xDF1DD471 | possible worlds. A pessimist is sure of it!

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
Please read the FAQ at

 \ /
  Last update: 2005-03-22 13:43    [W:0.022 / U:18.308 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site