McIDAS-X User's Guide
Version 2023.1
[Search Manual] [Table of Contents] [Go to Previous] [Go to Next]
Shell variables are not passed to mcenv unless they are first exported. If the script contains the mcenv command (as opposed to being run as argument of the mcenv command), any variables set before calling mcenv must be exported if they are to be used within the mcenv environment. In the example below, the variable SAT is being passed.
#!/bin/sh # Sample script # get first argument to script SAT=$1 export SAT # Set MCPATH MCPATH=/home/user/mcidas/data:/home/mcidas/data export MCPATH mcenv -f 520x690 << 'EOF' logon.k USER 1234 imgcopy.k ${SAT}/VIS MYDATA/VIS imgdisp.k MYDATA/VIS 1 frmsave.k 1 MYPICT.GIF exit EOF exit 0 |
If a script contains McIDAS commands with shell variables that are normally enclosed by single quotes, they will not be evaluated correctly unless you replace the single quotes with double quotes. For example, if your script has a ptdisp.k command with keyword SELECT='DAY ${year}${fday}; TIME 12; ST CA' (where year and fday are shell variables) you must change it to SELECT="DAY ${year}${fday}; TIME 12; ST CA" in order for the shell variables to be evaluated correctly.
[Search Manual] [Table of Contents] [Go to Previous] [Go to Next]