This works OK, but I can't pipe it to a file, i.e. I get a syntax error when I do
gemlist(fname,"100-102") \$this->_split2($m[0]) filelist
** Syntax error
**: gemlist(fname,"100-102") \$this->_split2($m[0]) filelist
The syntax in this case is to put the redirection inside the parenthesis as an addition argument, i.e.
PHP Formatted Code
gemlist
(fname
, "100-102", > "filelist")
Note that the refirected filename must be quoted if you are giving a literal file name such as 'filelist' in the example, otherwise it will be interpreted as a script variable.
Alternately, is there a way to force a parameter to be interpreted as a variable, e.g.
string fname
fname="aaa"
gemlist fname 100-102
and have "fname" interpreted as "aaa"
Here what you're trying to do is use the "command mode" syntax (i.e. what you normally use on the command line, the form with the parens is known as "program" or "compute" mode) with a script variable, to do this you need to first interpret the variable value to form a valid command. The usual trick to this is something like
PHP Formatted Code
print ("gemlist " // fname // " 100-102") | cl()
where you construct the command and pipe it to a CL to execute.
If you haven't already seen it you might check the Script Guide available from https://iraf.net/irafdocs/script for more details.[/code]