Welcome to iraf.net Friday, May 17 2024 @ 02:11 AM GMT


 Forum Index > Help Desk > Systems New Topic Post Reply
 scripting help needed
   
Anonymous: Guest
 03/03/2006 12:19PM (Read 3250 times)  



Dear.
I deeply appreciate if someone can help me.
I'm writing a iraf script something like
----------------------------
slist(filename, >> "output")
wc "output" | fields ("STDIN", "6") | scan (num_aper)
---------------------------
(part of my script) and I got a following error message.ERROR on line 309: Attempt to access undefined local variable
`num_aper'.This script works fine with my laptop computer but
it does not work with my workstation with dual xeon processors.
(I'm using Suse 9.1 professional for both machines.)
Could you possibly tell me what causes this problem?
Thank you very much.Jae-Woo Lee, Ph.D.
Assistant Professor
Dept. Astronomy & Space Science, Sejong University
98 Gunja-Dong, Gwangjin-Gu
Seoul, 143-747, KoreaT) 82-2-3408-3966
F) 82-2-3408-3916

 
 Quote
fitz
 03/03/2006 12:19PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
[quote:b33a5435bb]slist(filename, >> "output")
wc "output" | fields ("STDIN", "6") | scan (num_aper)
---------------------------
(part of my script) and I got a following error message.ERROR on line 309: Attempt to access undefined local variable
`num_aper'.[/quote:b33a5435bb] I'm not quite sure I understand your intention in the code snippet: The SLIST task produces a table where column 6 is the starting wavelength, but the 'wc' ouput only has four values in most cases. This means the FIELDS output should be empty and so 'num_aper' isn't defined and would account for the error. If all you want to do is count the number of lines of output from SLIST you could do it as slist (filename) | count ("STDIN") | scan (num_aper)To make sure the value was read you can use the nscan() afterward to verify at least one value was scanned. I can't explain why it works on one machine and not the other, the 'wc' should produce only 4 columns in an case. Hope this helps.Cheers,
-Mike

 
Profile Email
 Quote
   
Content generated in: 0.06 seconds
New Topic Post Reply

Normal Topic Normal Topic
Sticky Topic Sticky Topic
Locked Topic Locked Topic
New Post New Post
Sticky Topic W/ New Post Sticky Topic W/ New Post
Locked Topic W/ New Post Locked Topic W/ New Post
View Anonymous Posts 
Anonymous users can post 
Filtered HTML Allowed 
Censored Content 
dog allergies remedies cialis 20 mg chilblain remedies


Privacy Policy
Terms of Use

User Functions

Login