Welcome to iraf.net Saturday, May 11 2024 @ 01:46 PM GMT
prajwel |
04/12/2014 08:10AM (Read 1598 times)
|
|
|
Status: offline
Registered: 02/24/2014
Posts: 7
|
I'm having a hard time introducing an integer which I have defined in script to a simple "sed" command
I have declared variable in script like this
PHP Formatted Code int F =0
Now I put this in a while loop and get a particular value assigned to it. To know which file name this value corresponds to, I use this command
PHP Formatted Code !sed 'Fq;d' flats
where F is the integer and flats is a list of flat images.
Please help me out on this
|
|
|
|
fitz |
04/12/2014 04:02PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
What you're trying to do is mix literal strings and script variables, which you can do, but you have to create a new command string and then use the CL to execute it. For example,
PHP Formatted Code print ("!sed '" // F // "q;d' flats") | cl()
where the '//' is the string concatenation operator and the value of the F variable is put into the string.
If all you're doing is looping over the contents of the 'flats' file, the CL way to do this is
PHP Formatted Code
list = "flats"
while (fscan (list, s1 ) != EOF ) {
... do something withe 's1' variable that contains the next line of the file
}
For more on scripting see the guide at https://iraf.net/irafdocs/script/
|
|
|
|
| |
|
Content generated in: 0.16 seconds |
|