Hi All,
This script is not working. I want to change the directory as per users selection in current shell. Looks like it is spawning sub-shell internally.
I have used
. changedir.sh
source changedir.sh
./changedire.sh
But did not work. Currently shell directory remain the same.
Please correct my mistakes.
Thanks,
Ram
*************************
x=0
for tree in $( ls -l | grep "^d" | cut -c61- )
do
x=`expr $x + 1`
echo "$x $tree"
done
echo "Enter the view number to set or 0 to another view or q to quit"
read answer
y=0
for user in $( ls -l | grep "^d" | cut -c61- )
do
y=`expr $y + 1`
if [ $y == $answer ]; then
cd $user
echo "setting tree: $user"
fi
done
***************************