S="/data/source"
BR="/home/baruch"
U="/user/bin"
export S BR U
-----
cd $S
cd $BR
cd $U
The 'export' command will export the variables so they can be used after the shell program exits.
I recommend using uppecase monikers, since a lot of nonsense seeming lowercase ones may actually be unix commands and you could get unexpected results.
Is this more of what you are looking for?
Having a shell script physically move you to a new folder and then exit, leaving you in the new directory.. I've not done that other than spawning a new shell in the new directory, when exiting a shell, I am always left in the directory I called the original shell from.
Thanx agtan hemo
First sorry for my poor english....
I will give u other example.
1. i have a sh scrept like this. (called a).
A="/home/val" ;export A
cd $A
pwd
2. from the my prompt korn shell:
/abic0/prgmrs/baruch> sh -x a
+ A=/home/val
+ export A
+ cd /home/val
+ pwd
/home/val
/abic0/prgmrs/baruch>
3. My target was to be physically after exit scipt a
in the koren shell prompt, in /home/val directory.
4. in pc dos, i have a nice tool like bookmark.
directories i want frequent switch to them.
i have a txt file like above, and a cobol program
called CDN, that can execute pc command from inside,
so when i type CDN m , the dos prompt switched to c:\ms.
Most gegarts to your attention,
Barry
most regards
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.