[Thread Prev][Thread Next][Index]

Yet more on variable # of args to go script...



Sorry to keep asking about this, but I just can't get it.

Let's say I have a go script I want to call with 5 (or more) arguments, with
arguments 5 on up being the datasets I want to use, for example:

!                $1      $2     $3            $4             $5 - $(11)
!              field   scale  Title           Units          File(s)
go iced_2panel icea    1.e6   "Sea Ice Area"  "10^6 km^2"    b704 b702 b705

Arguments 1-4 will always be there; what I don't get is how I can check for the
existence of args 5+ so I can use them in the script. Ideally, I'd like to have
one big script to handle as many datasets as I can toss at it, rather than sep-
arate scripts for 1 dataset, 2 datasets, 3 datasets, and so on. I've tried the
following (as an example of what I'd like) and it just doesn't work:

-------------------------------------------------------------------------------
! [...]
!
if $5"True|*>False|" then
  set mode meta $5.$1.plt
elif $6"True|*>False|" then 
  set mode meta $5.$6.$1.plt
elif $7"True|*>False|" then
  set mode meta $5.$6.$7.$1.plt
elif $8"True|*>False|" then 
  set mode meta $5.$6.$7.$8.$1.plt
elif $9"True|*>False|" then
  set mode meta $5.$6.$7.$8.$9.$1.plt
elif ($10)"True|*>False|" then 
  set mode meta $5.$6.$7.$8.$9.($10).$1.plt
elif ($11)"True|*>False|" then 
  set mode meta $5.$6.$7.$8.$9.($10).($11).$1.plt
endif
!
! [...]
-------------------------------------------------------------------------------

Any ideas would be *most* appreciated!
--
/\        Gary Strand (303) 497-1336                                NCAR ML262A
  \_][    www.cgd.ucar.edu/ccr/strandwg                      1850 Table Mesa Dr
      \___strandwg@ucar.edu                       Boulder, Colorado, USA  80305


[Thread Prev][Thread Next][Index]

Dept of Commerce / NOAA / OAR / PMEL / TMAP

Contact Us | Privacy Policy | Disclaimer | Accessibility Statement