Sorry, I overlooked your use of multiple quotes. I didn't test it on my Kindle but hopefully the one or the other command works there:
cat /tmp/messages | awk -v date="$(date +%X | cut -d':' -f-2)" '/^[0-9:]++ [a-z]++.[0-9]++.: I [a-zA-Z]++:[a-zA-Z]++
PageTurnAction|Foo)/ {system("echo ffff "date)}'
Using strftime my awk version returns the 24h format while gawk works fine.
cat /tmp/messages | awk '/^[0-9:]++ [a-z]++.[0-9]+.: I [a-zA-Z]++:[a-zA-Z]++
PageTurnAction|Foo)/ {date=substr(strftime("%X"),0,5); system("echo ffff "date)}'
You should really optimize the expressions to avoid backtracking - with your expression this may happen 4 times for each character in every line if the line does not match.
http://stackoverflow.com/questions/3...tomic-grouping is interesting.