On Fri, 23 Jun 2000, Rajeev Jha wrote:
> worst part is that cd command has an exit status of 0, would like someone
> to clear this point
The exit status is 0 since the command _was_ successful. The
file you ran is executed in a new shell and the shell ends after execution
The proof is here:
On my system i created a file named arbit.
<ajayd@ajayd> cat arbit
#!/bin/sh
cd /usr/tmp
echo `pwd`
<ajayd@ajayd> ./arbit
/***** A fortune which i have in the .profile and .bashrc***/
/usr/tmp
logout
The exit status from the shell is 0 since it exited noramlly ie after
doing what was expected of it.
EnjoyLife...........
Ajay kumar Dwivedi
-----------------------------------------------------------------------
Check out the 'What to do before posting to the list' site
for a list of things to try before posting. The site is
at http://botsie.tripod.com/beforeposting/