0

I am trying to pipe a stream of string date values (YY-MM-DD HH:MM:SS) and return their epoch values and then find the largest and smallest value. For a small file, this works fine. However upon using it on a larger file, the limitations of xargs causes it to break down. is there any quick, good alternative?

The line looks as follows:

awk function on a file ... | xargs -i date -d "{}" +%s | another awk function ...


Tried (and failed) originally to pipe into a perl script and may return to that if there isn't a quick win in bash.

2
  • If you could give a little bit more information I could put together a script for you. This is precisely the type of task that AWK was built to handle and there's no reason to pipe from one awk process to another. Write one script that calls out to date as needed and processes everything internally. Mar 3, 2014 at 6:05
  • yeah, I realised after a bit more sleuthing that awk actually does everything I wanted. I forgot to close this. Thanks though! Mar 3, 2014 at 14:29

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.