> On/in VMS, it is very easy to write scripts or command files to change directory and to list the contents of the new directory.
>> When I try to write a unix script, it does it "behind the scenes".
>> for example if i want to go to a directory called data and list files:-
>> #a script to go to data and list
> cd jenkins/data
>> It will go to directory data and list files, but at the end, i will be in the directory i started in.
>> Any suggestions
Confounding when you start but you'll eventually prefer Unix over VMS (and
then again, perhaps not). I would presume that the reason that your new
changed directory doesn't "stick" is because you are executing your script
rather than "sourcing" it. In other words, instead of running your script
...you should run it by typing ...
% source myprogram
By sourcing, the changes effect your current shell. If you execute (rather
than sourcing), the program automatically creates a daughter shell (subprocess),completes the script, kills the subprocess, and returns to the original,
If you find the new script useful and would like to set up a shortcut to
source it, you can make an alias. For example, when you launch the "gcg"
command you are using the alias supplied by GCG...
alias gcg 'source $GCGCOREROOT/genetics'
... to source the "genetics" file which sets up your environment for using
the GCG programs.
bollingt at ugene1.abbott.com