Re: Should dot command log me out? Excuse me if it is not a kernel

Joseph Malicki (jmalicki@geocities.com)
Tue, 28 Jul 1998 18:56:14 -0400


Frank Peng wrote:

> Appreciate your help:
>
> See this program named test.sh:
>
> #!/bin/sh
> echo $USER
> exit 0
>
> At the Linux prompt, type . test.sh
> It will logout out and ask my login in again.
>
> 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 . test.sh
>
>
>
>

Well, it is normal..... the . command works like C #include.... it acts as if

you typed everything on the command line.... so when it sees
exit 0, it exits... the fix is to remove exit 0, and it will also work
when you type ./test.sh.

Joseph Malicki

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html