View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

make the cl not complain about files existing?

sirmarcos wrote on Feb 07, 2006

Hello,

So, I write a wide range of iraf cl scripts and one thing I often do is use hselect to create file lists. So something like:

hselect *.fits $I, expr="imagetyp == 'object'" > object_list

However, if I ever run the script again, the cl whines that it can't write to the file object_list, because it already exists.

Any way to make the darn CL just overwrite on a > like any unix script would? Perhaps some other character other than >... or whatever? I know in tcsh there's some noclobber variable that has to be set to prevent overwriting... perhaps there's some analogous clobber variable in IRAF?

Marcos

Mike Fitzpatrick wrote on Feb 07, 2006

Just set the 'clobber' CL variable, e.g.

cl> show clobber
no
cl> type hlib$motd > foobar
cl> type hlib$motd > foobar
ERROR: cannot open `foobar' for writing
cl> reset clobber = yes
cl> type hlib$motd > foobar

There is an analogous 'imclobber' var. Use both with care.

-Mike

Last post on Feb 07, 2006