Welcome to iraf.net Wednesday, May 01 2024 @ 10:14 PM GMT
dadykhoff |
02/12/2014 02:31PM (Read 1979 times)
|
|
|
Status: offline
Registered: 02/10/2014
Posts: 1
|
Hi,
I am trying to run the following command:
PHP Formatted Code imhead @infileJ_M74 long + | grep TELRA | awk -F\ ' '{print $ 2}'
The first pipe works fine and outputs this:
PHP Formatted Code TELRA = '01:37:31.06' /
TELRA = '01:37:31.04' /
TELRA = '01:37:31.03' /
TELRA = '01:37:32.39' /
TELRA = '01:37:32.36' /
TELRA = '01:37:32.41' /
TELRA = '01:37:32.38' /
TELRA = '01:37:33.74' /
TELRA = '01:37:33.82' /
TELRA = '01:37:33.82' /
TELRA = '01:37:33.77' /
If I perform the awk pipe in a normal terminal window (Ubuntu 12.04 64bit), it pulls the data that I want (e.g. 01:37:33.77) But when I try to use the awk in IRAF, I am getting the following error:
PHP Formatted Code ecl > imhead @infileJ_M74 long + | grep TELRA | awk -F\ ' '{print $ 2}'
/bin/bash: -c: line 0: unexpected EOF while looking for matching `''
/bin/bash: -c: line 1: syntax error: unexpected end of file
Is there something additional I need to know about escaping special characters in IRAF (e.g. \')? Or maybe its something to do with using UNIX commands in IRAF. Any help is appreciated! Thank you.
|
|
|
|
fitz |
02/12/2014 04:23PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
Using escaped characters in foreign tasks can be tricky because of the parsing in the CL. For your example the command which works is
imhead @infileJ_M74 long_ | grep TELRA | awk ("-f\\'", "'{print $2}'")
where the second escape of the single-quote and the 'compute mode' syntax solves the problem.
Note a much simpler method is to use the HSELECT task instead, i.e.
hselect @infileJ_M74 TELRA yes
|
|
|
|
| |
|
Content generated in: 0.14 seconds |
|