About Chandra Archive Proposer Instruments & Calibration Newsletters Data Analysis HelpDesk Calibration Database NASA Archives & Centers Chandra Science Links

Skip the navigation links
Last modified: April 2009

URL: http://cxc.harvard.edu/sherpa4.1/script.sl.html
AHELP for Sherpa 4.1

script

Context: sl.sherpa

Synopsis

Save every command typed in a Sherpa session to a file.

Syntax

script([filename="sherpa.log"; clobber=0]);

Description

The script function saves every command typed in a Sherpa session to the file specified in the 'filename' argument; by default, the file "sherpa.log" is used. If the file already exists in the current working directory, it can be clobbered by setting the 'clobber' argument to 1.

  • filename - the name of the file to write; default = sherpa.log
  • clobber - Boolean to specify if existing 'filename' should be overwritten; default = 0

Example 1

sherpa> script("sherpa_session1.log"; clobber=0) ;

This command will record *everything* typed at the command line in a Sherpa session to the file "sherpa_session1.log", unless this filename already exists in the current working directory.

Setting clobber=1 overwrites "sherpa_session1.log":

sherpa> script("sherpa_session1.log");
script file "sherpa_session1.log" exists and clobber is not set.

sherpa>  script("sherpa_session1.log"; 1);
Input saved to sherpa_session1.log

Example 2

sherpa> script();

When issued with no arguments, the 'script' command writes to "sherpa.log"; clobber is turned off by default.

sherpa> script();
Input saved to sherpa.log

sherpa> script();
script file "sherpa.log" exists and clobber is not set.

Bugs

See the bugs pages on the Sherpa website for an up-to-date listing of known bugs.

Last modified: April 2009



The Chandra X-Ray Center (CXC) is operated for NASA by the Smithsonian Astrophysical Observatory.
60 Garden Street, Cambridge, MA 02138 USA.    Email: cxcweb@head.cfa.harvard.edu
Smithsonian Institution, Copyright © 1998-2004. All rights reserved.