next up previous 405
Next: Assigning scalar values
Up: C-shell Cookbook
Previous: Some simple examples


Shell Variables

The shell lets you define variables to perform calculations, and to pass information between commands and applications. They are either integers or strings, however it is possible to perform floating-point arithmetic by using certain applications in your script (see here). You don't need to declare the data type explicitly; the type is determined when you assign a value to a variable.

Variables are only defined in the current process. If you want global variables, i.e. ones that are available to all processes, you should assign them in your .cshrc file.

Variable names comprise up to 20 letters, digits, and underscores; and should begin with a letter or underscore.


Subsections

next up previous 405
Next: Assigning scalar values
Up: C-shell Cookbook
Previous: Some simple examples

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