From: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Friday, June 30, 2000 8:57 AM
>Rohit wrote:
>> "Lakshmi B. G." wrote:
>> > I have created a small file called l.txt which has simple 2 statements
>> > /bin/sh
>> > cd /usr/local
>>
>> You are running a shell and call this file.
>> First instruction from parent shell is to fork another shell.
>> So long as this child shell is existent, the parent command-2 will not
>> execute.
>> So, if you press control-D and exit from child shell, it will cd to that
>> directory..
>i would differ.
>what is the purpose of Lakshmi creating a child shell by giving /bin/sh
>and coming out without doing anything there?
>
>i guess that he wants to "cd /usr/local" in the new child shell.
>how to do THAT?
There's a question of env variables, when the child shell is killed
it does'nt pass on it's env variables to it's parent process unless,
exported . If all you want to do is go to a particular directory on login
put cd /usr/local in the .bash_profile.
If you want to go when you want put it in a script and run it in the present
shell with a $. <script name> ( not sh)
Bye
Kaushik
"1. To err is human... to blame your computer for your mistakes
is even more human, it is downright natural.
2. A computer program will always do what you tell it to do,
but rarely what you want to do."
� Murphy's Laws of Computing
-----------------------------------------------------------------------
For information on this and other Linux India mailing lists check out
http://lists.linux-india.org/