Welcome to iraf.net Friday, March 29 2024 @ 04:52 AM GMT


 Forum Index > Help Desk > General IRAF New Topic Post Reply
 Mac-Intel with simple IRAF scripts
   
jpizagno
 01/18/2007 08:18PM (Read 9261 times)  
+----
Newbie

Status: offline


Registered: 01/18/2007
Posts: 1
Dear IRAFers,
I recently purchased a Mac (OS X,
dual core processor) and have
installed IRAF. The IRAF commands
seem to work well, except for
scripts. My scripts that ran on a
Linux box do not work on the Mac,
even simple scripts. For example, if I make a simple
script file, "simple.cl" that looks like:"pwd
display J9CV01.fits 1
imexam"then type
"cl> cl < simple.cl"

IRAF returns"INTERNAL ERROR: parser gagged
called at: 'cl ()' "Does anybody know what is going on?
I'm working on a xgterm, that I started
through x11. As I said, all these
commands (display, imexam) work
when not in the script file. It also
seems to get through certain parts of
the script but not others. In the example
above, it does display the image, but
bombs when trying to .IMEXAM.thanks for any help you may provide,Jim

 
Profile Email
 Quote
fitz
 01/18/2007 08:18PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
How did you create the 'simple.cl' script file, i.e. what is with an editor like vi/emacs or or the Mac textedit app or something else? The 'parser gagged' error comes about when the text doesn't parse into a valid command stream, this can happen when e.g. the file doesn't have a trailing '\n' or EOF (can happen in emacs or BBEdit for instance). Using 'vi' I'm able to create a simple command file that works as expected. You can try something like[code:1:220543fbdf]cl> print ("pwd\ndisplay dev$pix 1\nimexam\n", > "foo.cl")
cl> cl < foo.cl[/code:1:220543fbdf]to check that the commands do indeed work. Hope this helps.Cheers,
-Mike

 
Profile Email
 Quote
sirmarcos
 01/18/2007 08:18PM  
++---
Junior

Status: offline


Registered: 12/05/2005
Posts: 32
Following up on what Mike said, Macs, Windows, and UNIX all use a different character for the return or end of line. If you're making scripts on a Mac be sure to use a program like TextWrangler which can translate line breaks, and also I believe uses UNIX breaks by default.

The re-born Mac IRAF web site: http://macsingularity.org
 
Profile Email Website
 Quote
Fenris
 01/18/2007 08:18PM  
+----
Newbie

Status: offline


Registered: 02/14/2007
Posts: 7
I'm another user of IRAF on a Mac (not by my choice), and have similar problems with the parser gagged error. I run IRAF in an xgterm window under X11, I've written my scripts with emacs, and sometimes they run fine, while sometimes the parser gags which I then gather is due to the line breaking somehow not getting properly done. Is there any way to make this work on emacs, generally? What's this with adding "EOF", how do I do that?Also, I tried entering the script as given by fitz and it worked fine. Bit of a hassle writing long scripts on the command line though, and I'd rather not have to learn vi right now either as I've only just got around to somewhat understanding emacs Smile.Most grateful for any input. Cheers.

 
Profile Email
 Quote
fitz
 01/18/2007 08:18PM  
AAAAA
Admin

Status: offline


Registered: 09/30/2005
Posts: 4040
The "problem with emacs" is that it allows you to sometimes create a file without a newline, this is a problem for the CL parser and many unix tasks as well. The key to this seems to be to have the following lines/values in your .emacs file:[code:1:47e0128749]
;; always end a file with a newline
(setq require-final-newline t);; stop at the end of the file, not just add lines
(setq next-line-add-newlines nil)
[/code:1:47e0128749]Then even if you don't explicitly add a newline it will be written for you. There are a whole bunch of rules about what happens if the file was originally in DOS format, is on a Samba share, what major mode you're in etc that I know nothing about. Basically, check for the newline....(This message powered by 'vi' )-Mike

 
Profile Email
 Quote
rkbarry
 01/18/2007 08:18PM  
+----
Newbie

Status: offline


Registered: 02/04/2008
Posts: 6
Hi, I'm attempting to write CL code for my macintel using textwrangler. However, I am still getting the helpful "parser gagged" message. I see that someone suggested using textwrangler as a solution. How can I convince textwrangler to put an endofline at the end of each line of my cl script?Thanks in advance!RKBarry Frown

 
Profile Email
 Quote
   
Content generated in: 0.17 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