On Wed, 24 Mar 2010, Cathey, Jim wrote:
> A shell script?
> 
>       while :; do
>               read LINE
>               echo `date`: $LINE
>       done <ttydev >logfile

Better:

        while read -r; do
            echo "$(date): $REPLY"
        done <ttydev >logfile


If you use `read -r` you get the raw line, it's sensible to exit the loop 
on end of input, and I don't understand why anybody still uses backticks 
for command line sub-shells!
_______________________________________________
busybox mailing list
[email protected]
http://lists.busybox.net/mailman/listinfo/busybox

Reply via email to