NRAO Home > CASA > CASA Cookbook and User Reference Manual

B.7 System shell access

For scripts, the os.system methods are the preferred way to access system shell commands (see § B.7.1).

In interactive mode, any input line beginning with a ’!’ character is passed verbatim (minus the ’!’) to the underlying operating system. Several common commands (ls, pwd, less) may be executed with or without the ’!’. Note that the cd command must be executed without the ’!’, and the cp command must use ’!’ as there is a conflict with the cp tool in casapy.

For example:

  CASA [1]: pwd  
  /export/home/corsair-vml/jmcmulli/data  
  CASA [2]: ls n*  
  ngc5921.ms ngc5921.py  
  CASA [3]: !cp -r ../test.py .

  B.7.1 Using the os.system methods
  B.7.2 Directory Navigation
  B.7.3 Shell Command and Capture


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