We can also write new headers at specified locations (the default being just before the END card), or revise the value and/or comment of existing headers. As we know the header AIRMASS exists in image123, the following revises the value and comment of the AIRMASS header. It also writes a new header called FILTER immediately preceding the AIRMASS card assigning it value B and comment Waveband.
fitswrite image123 airmass value=1.062 comment=\"Corrected airmass\"
fitswrite image123 filter position=airmass value=B comment=Waveband
As we want the metacharacters " to be
treated literally, each is preceded by a backslash.
C-shell Cookbook