unix script files

Gerard Stafleu gerard at uwovax.uwo.ca
Tue Mar 29 15:08:04 EST 1994

In article <2n992t$n1b at mserv1.dl.ac.uk>, jenkins at aidsun.nibsc.ac.uk writes:
> Can any body help me??
> 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
> ls 

put the following line in your .cshrc, or in .aliases if that is where
aliases are defined:

alias x 'cd \!* ; ls'

the command x will now do what you want.  Alternatively, you can make a
file doit, and make the alias:

alias x 'source ~username/bin/doit'

doit contains csh commands, not sh.  The above assumes that username is
your user name (substitute as necessary) and that you put the file in a
subdirectory bin.
doit looks like:

cd $1

Gerard Stafleu
email: gerard at uwo.ca
ITS, University of Western Ontario,
London, Ontario, Canada N6A 5B7

More information about the Info-gcg mailing list

Send comments to us at biosci-help [At] net.bio.net