[
Date Prev][
Date Next][
Thread Prev][
Thread Next][
Date Index][
Thread Index]
20021120: running RSMAS IMGLIST/IMGCOPY scripts from 'mcidas' account (cont.)
- Subject: 20021120: running RSMAS IMGLIST/IMGCOPY scripts from 'mcidas' account (cont.)
- Date: Thu, 21 Nov 2002 10:00:27 -0700
>From: Angel Li <address@hidden>
>Organization: U Miami/RSMAS
>Keywords: 200211150406.gAF46PL16731 McIDAS mcenv SHELL scripts
Angel,
>I tried running one of my get data from Wisconsin scripts as user mcidas
>and I'm getting errors from the imglist.k command:
>
>mcidas* ./lister N15 GAC
>LOGON in progress...
>LOGON to McIDAS-X completed.
>Image file directory listing for:GILMORE/N15GAC
>mcserv: illegal option -- R
>Usage is: mcserv [options] [-p portnum]
>
>options are:
>-d become a daemon (sets -q)
>-q quiet mode
>-f force ftp authentication
>-v verbose mode
>-p to specify a port number to listen
>imglist.k: done
This looks like a program named mcserv that is not the one in McIDAS
is being run. Yup, that's it. If I logon as 'ldm' here is what I find:
ldm% which mcserv
/usr/local/bin/mcserv
This is not the case for the user 'mcidas', however, since the
/mcidas/bin directory is part of the PATH defined in 'mcidas's .cshrc
file.
By the way, what _is_ the appropriate shell definition file for 'gsh'?
Is it .cshrc or .bashrc?
I decided to see how 'lister' would need to be changed to run from the 'ldm'
account. Here is what I came up with:
o since MCDATA, MCPATH, etc. are no longer defined in 'ldm's .cshrc file,
they have to be defined in the script. The lines were already in
'lister', but they were commented out.
o next, mcenv, will source .cshrc if the SHELL for the user running it
is the C shell (or TC shell). Because of this, I always stick in
some lines to change the SHELL to the Bourne shell:
SHELL=/bin/sh
export SHELL
The modified 'lister' script now reads:
#!/bin/sh
#
# List all passes residing in a remote server
#
# Must run this as user "mcidas"
#
SHELL=/bin/sh
export SHELL
MCHOME=/mcidas
MCDATA=/ldm/mcidas/data
#MCLOG=$MCDATA/XCD_START.LOG
MCPATH=${MCDATA}:$MCHOME/data:$MCHOME/help
PATH=$MCHOME/bin:/usr/local/bin:/usr/bin:/usr/bin/X11:/usr/sbin
export MCPATH PATH
if [ $# != 2 ]; then
echo usage $0 satellite dataType
exit 1;
fi
data=$1$2
#
# Now many passes to list
#
nPasses=30
mcenv <<EOF
logon.k UMIA 6999
imglist.k GILMORE/$data.-$nPasses || exit 1
exit 0
EOF
The changes were:
1) add definition and export of SHELL
2) uncomment MCHOME, MCDATA, MCPATH, and PATH
3) export MCPATH and PATH
Exporting of MCDATA and MCHOME is not necessary. McIDAS really only
uses MCPATH. I define MCHOME and MCDATA to reinforce the concepts
of where McIDAS is installed, and what the McIDAS working directory
(MCDATA) will be.
After making these changes, 'lister' runs correctly as the user 'ldm':
ldm% ./lister N15 GAC
LOGON in progress...
LOGON to McIDAS-X completed.
Image file directory listing for:GILMORE/N15GAC
Pos Satellite/ Date Time Center Band(s)
sensor Lat Lon
--- ------------- ------------ -------- ---- ---- ------------
29 NOAA-15 21 NOV 02325 14:39:06 -74 -85 1-6
1 NOAA-15 21 NOV 02325 04:03:13 -29 -26 1-6
268 NOAA-15 21 NOV 02325 02:22:36 -27 -52 1-6
264 NOAA-15 21 NOV 02325 00:33:59 -17 -79 1-6
248 NOAA-15 20 NOV 02324 18:09:11 -71 -154 1-6
243 NOAA-15 20 NOV 02324 16:29:01 -74 -173 1-6
239 NOAA-15 20 NOV 02324 15:02:54 -74 -80 1-6
240 NOAA-15 20 NOV 02324 13:13:53 -61 -88 1-6
212 NOAA-15 20 NOV 02324 04:26:31 -30 -20 1-6
207 NOAA-15 20 NOV 02324 02:46:11 -28 -45 1-6
204 NOAA-15 20 NOV 02324 01:04:46 -30 -70 1-6
201 NOAA-15 19 NOV 02323 23:16:10 -16 -99 1-6
186 NOAA-15 19 NOV 02323 18:32:41 -70 -149 1-6
181 NOAA-15 19 NOV 02323 16:54:07 -76 -161 1-6
178 NOAA-15 19 NOV 02323 15:12:21 -76 175 1-6
173 NOAA-15 19 NOV 02323 13:37:11 -81 -145 1-6
imglist.k: done
For interest, I copied the original version of 'lister' to the
/mcidas/scripts directory and ran it from there as 'mcidas' with
no alterations. There were no problems:
mcidas* cd /mcidas/scripts
mcidas* ./lister N15 GAC
LOGON in progress...
LOGON to McIDAS-X completed.
Image file directory listing for:GILMORE/N15GAC
Pos Satellite/ Date Time Center Band(s)
sensor Lat Lon
--- ------------- ------------ -------- ---- ---- ------------
29 NOAA-15 21 NOV 02325 14:39:06 -74 -85 1-6
1 NOAA-15 21 NOV 02325 04:03:13 -29 -26 1-6
268 NOAA-15 21 NOV 02325 02:22:36 -27 -52 1-6
264 NOAA-15 21 NOV 02325 00:33:59 -17 -79 1-6
248 NOAA-15 20 NOV 02324 18:09:11 -71 -154 1-6
243 NOAA-15 20 NOV 02324 16:29:01 -74 -173 1-6
239 NOAA-15 20 NOV 02324 15:02:54 -74 -80 1-6
240 NOAA-15 20 NOV 02324 13:13:53 -61 -88 1-6
212 NOAA-15 20 NOV 02324 04:26:31 -30 -20 1-6
207 NOAA-15 20 NOV 02324 02:46:11 -28 -45 1-6
204 NOAA-15 20 NOV 02324 01:04:46 -30 -70 1-6
201 NOAA-15 19 NOV 02323 23:16:10 -16 -99 1-6
186 NOAA-15 19 NOV 02323 18:32:41 -70 -149 1-6
181 NOAA-15 19 NOV 02323 16:54:07 -76 -161 1-6
178 NOAA-15 19 NOV 02323 15:12:21 -76 175 1-6
173 NOAA-15 19 NOV 02323 13:37:11 -81 -145 1-6
imglist.k: done
It looks like, therefore, that you could simply copy your /ldm/gilmore
stuff to /mcidas and run the scripts from the 'mcidas' account with
no problems. I didn't try this, so there may be a tweak or two that
is needed.
Tom