I made a script:
I run the script and see:#!/bin/sh
# script to make /mnt/sda1/ ... /text the working directory
echo switching to new directory
cd /mnt/sda1/Law/bNgo/Transcript/text
echo -n working directory is:
pwd
switching to new directory
working directory is:/mnt/sda1/Law/bNgo/Transcript/text
I'm there! The script has switched to the new directory! Great!
Then, when I use the command: pwd (in LXTerminal) I see:
/root
Somehow - after running the script - the working directory reverts to the directory calling the script. WHAT! SHOCK! BOTHER. DRAT. boy-OH-boy.
Lots of little gotcha's in here.
Can anyone tell me how to make bash REMAIN in the directory the script transferred to? Please? Clearly bash remember 'where' and (after running) it goes back to 'where'. Calling the script from '/root/ returns to /root. Calling from /home returns to /home. Oh-boy!
Leslie
Maybe I can make a variable to stay in the root directory and trick bash so it thinks I'm in the text directory. Also, I want to keep my work in /mntsda1. I don't want to do my work "under" /root. (But maybe someone will tell the that's the best idea ...)