next up previous 405
Next: Some simple examples
Up: Running a script
Previous: Executing a script in the current process


Package aliases

While convenient, the creation of aliases in your .cshrc file does have a drawback: if you define many aliases in the .cshrc file, it will decelerate process activation. One way around that is to define a few aliases that run other scripts, each of which in turn define many related aliases. Thus you only create the definitions when they are required. This is how most Starlink packages define their commands. Here is an example. Suppose you had a package or a set of related commands called COSMIC installed in directory /home/user2/dro/cosmic, you would first place the following line in your .cshrc file.

     alias cosmic `source /home/user2/dro/cosmic/cosmic.csh`
The left quotes mean execute the command between them. So when you enter

     % cosmic
the script /home/user2/dro/cosmic/cosmic.csh is run. This file might look like the following.

     #!/bin/csh
     alias abund /home/user2/dro/cosmic/abundance
     alias filter `source /home/user1/abc/bin/garbage.csh`
     alias kcorr /home/user2/dro/cosmic/k-correction.csh
     alias radial /home/user2/drmoan/noddy/radial
     alias seeing $KAPPA_DIR/psf isize=21 psf=psf21
     alias zcol kcorr bands=UJR noevol



next up previous 405
Next: Some simple examples
Up: Running a script
Previous: Executing a script in the current process

C-shell Cookbook
Starlink Cookbook 4
Malcolm J. Currie
2006 November 26
E-mail:ussc@star.rl.ac.uk

Copyright © 2009 Science and Technology Facilities Council