Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 
Table of contents Previous: Running Scripts and Commands Using mcenv Next: Running mcenv From cron

Starting Shell Scripts That Run mcenv

Other programs and scripts can run mcenv. The example below shows a shell script that runs a mcenv script. The mcenv script appears in bold.

#!/bin/sh
# Sample script

MCPATH=/home/user/mcidas/data:/home/mcidas/data
export MCPATH

mcenv -f 520x690 << 'EOF'
logon.k USER 1234
imgcopy.k EAST/VIS MYDATA/VIS
imgdisp.k MYDATA/VIS 1
frmsave.k 1 MYPICT.GIF
exit
EOF
exit 0

The mcenv script runs everything from the logon.k command to the EOF statement within the McIDAS environment set with a 520x690 frame. Note that single quotes surround the first EOF in the first line of the mcenv script. Single quotes prevent the shell from substituting any variables within the mcenv script before they are set to the correct value.


Table of contents Previous: Running Scripts and Commands Using mcenv Next: Running mcenv From cron
 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Office of Programs University Corporation for Atmospheric Research (UCAR)   Unidata is a member of the UCAR Office of Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690