NRAO Home > CASA > CASA Cookbook and User Reference Manual
1.3.7.5 System shell access

If you want to access system commands from a script, use the os.system command (Appendix B.7.1).

In interactive mode, any input line beginning with a ’!’ character is passed verbatim (minus the ’!’, of course) to the underlying operating system. Also, several common commands (ls, pwd, less) may be executed with or without the ’!’, although the cp command must use ’!’ and cd must be executed without the ’!’. For example:

  CASA <5>: !rm -r mydata.ms

Note that if you want to access a Unix environment variable, you will need to prefix with a double $$ instead of a single $ — for example, to print the value of the $PAGER variable, you would use

  CASA <6>: !echo $$PAGER

See Appendix B.7 for more information.


More information about CASA may be found at the CASA web page

Copyright © 2010 Associated Universities Inc., Washington, D.C.

This code is available under the terms of the GNU General Public Lincense


Home | Contact Us | Directories | Site Map | Help | Privacy Policy | Search