I was wondering how I can iterate over each line of the output of a command and pass it as command line arguments to another one. I want to do this in a non-blocking fashion as the output never reaches an EOF.
To be more precise I want to take each line of output from acpi_listen and pass it to a user-level acpi handler script similarly to what acpid does as root(eg. "button/lid LID close" where $1="button/lid" $2=LID $3=close).
tail -f acpi_listen | yourscript(using areadlineloop)? – Tobias Kienzler Sep 6 '12 at 9:48