hi list
you wrote >>What do you mean by /bin/sh?
starting a shell
you wrote >>I have created a small file called l.txt which has simple 2 statements
you wrote >>/bin/sh
you wrote >>cd /usr/local
you wrote >>tho' it creates a bash shell it does not go to the specified directory.
you wrote >>what could be the problem
you wrote >>
yes i tried out the same thing , this cd ${DIR} inside a script is not
changing to the directory specified , although typing the same thing from
command line has the desired effect. ideally, it should bcuz many
system-specific shell script use 'cd'. here is the output from my machine
:
Script started on Fri Jun 23 09:50:09 2000
[root@penguin shell]# cat test
#!/bin/bash
DIR_CHANGE=/usr/local/apache
echo ${DIR_CHANGE}
cd ${DIR_CHANGE}
[ $PWD = /usr/local/apache ]
FLAG=$?
echo " FLAG = $FLAG "
if [ $FLAG -eq 0 ]; then
echo " success"
else
echo "command failed "
fi
[root@penguin shell]# ./test
/usr/local/apache
FLAG = 0
success
[root@penguin shell]# exit
exit
worst part is that cd command has an exit status of 0, would like someone
to clear this point
regards
___________________________________________________________
Rajeev Jha Email : [EMAIL PROTECTED]
(20) 5424301 -1126 Sharda centre
_____________________________________________________________
-----------------------------------------------------------------------
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/