#! /bin/sh fsmprint -l | awk ' /^::FSM::/ && /transducer/ { t = 1; next } /^::FSM::/ && /acceptor/ { t = 0; next } NF == 1 { print $1 } NF == 2 { print $1, $2 } NF == 4 { if (t) print $1, $2, 0 else print $1, $2, 0, $4 } NF == 5 { print $1, $2, 0, $5 } ' | fsmcompile