Starlink / starlink

Starlink Software Collection
162 stars 53 forks source link

convertawk script and gawk version 5 warning #66

Closed pwdraper closed 4 years ago

pwdraper commented 4 years ago

Reported by a user:

On FC31 when running gaia I getting this

convertawk:2: warning: regexp escape sequence `!' is not a known regexp operator

Seems that gawk has been updated to version 5 with a lot of changes, which includes issuing this warning. The problem is the line:

/^\!/  {if(out==0)

which I think should b:

/^!/  {if(out==0)

no need to protect the ! as it is not special in awk. Works on my local machines, but others should check this before committing.

dsberry commented 4 years ago

I can confirm that making this change does not break anything on FC 28 (gawk 4.2.1). To test it, I did:

% convert
% kappa
% cadd $KAPPA_DIR/m31 0 aaa.fit
<edit $CONVERT_DIR/convertawk to remove the backslash>
% stats aaa.fit
<check stats are displayed without error>
% touch bbb.fit    <i.e. create an invalid fits file>
% stats bbb.fit
<check error is reported including "!! ** Error converting from FITS to NDF using FITS2NDF">