awk - pipe not working…
AnTaR3s wrote on Mar 15, 2010
Hi!
I have a problem with a pipe in IRAF. Lets make it simple:
When I read out statistics with imstat i can't pipe the output into awk which in turn could print a single column
i.e.:
imstat NGC1893*.fits | awk '{print $4}' #(should print column 4)
gives
ERROR: task `awk' not found
When I redirect the imstat output into a file and use awk on the file it works as it should. Is there a way to make that work or another simple way of printing particular columns of an output?
cheers
I have a problem with a pipe in IRAF. Lets make it simple:
When I read out statistics with imstat i can't pipe the output into awk which in turn could print a single column
i.e.:
imstat NGC1893*.fits | awk '{print $4}' #(should print column 4)
gives
ERROR: task `awk' not found
When I redirect the imstat output into a file and use awk on the file it works as it should. Is there a way to make that work or another simple way of printing particular columns of an output?
cheers
Mike Fitzpatrick wrote on Mar 15, 2010
'awk' is a foreign command but isn't declared in the login.cl file as such, e.g. the way 'ls' or 'date' are. You can either add this to the login.cl file or else have a look at the FIELDS task to select individual columns, or set the 'fields' param to IMSTAT to print a single value.
AnTaR3s wrote on Mar 15, 2010
I considered the other options you gave here, but simply as a matter of efficiency it would be best to include awk as a recognized task.
I didn't think that its so simple to add a bash command just by writing it into the login.cl.
It's working now, thanks! :)
I didn't think that its so simple to add a bash command just by writing it into the login.cl.
It's working now, thanks! :)
Last post on Mar 15, 2010