#!/bin/bash while true do read LINE || break NUM=$(echo $LINE | awk '{print $1}') POS=$(echo $LINE | awk '{print $2}') echo $POS | egrep '^[0-9]' &> /dev/null || continue echo -n "$NUM " POS=$(echo $POS | \ python -c ' line = __import__("sys").stdin.read() print line[0:2] + ":" + line[2:4] + ":" + line[4:8], \ line[8:11] + ":" + line[11:13] + ":" + line[13:15] ') DEG=$(skycoor -d $POS) echo $DEG | awk '{print $1, $2}' done