Skip to content

Commit

Permalink
iii: respect line formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
c00kiemon5ter committed Nov 19, 2012
1 parent 3dd523e commit 4bc35ed
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions iii.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@ mark() {
trap "stty '$(stty -g)'; kill -TERM -0" EXIT
stty -echonl -echo

tail -f -n "$h" "$i/$n/$c/out" | while read -r date time nick mesg; do
tail -f -n "$h" "$i/$n/$c/out" | while IFS= read -r mesg; do
date="${mesg%% *}" mesg="${mesg#* }"
time="${mesg%% *}" mesg="${mesg#* }"
nick="${mesg%% *}" mesg="${mesg#* }"

case "$nick" in \<*\>) nick="${nick#<}" nick="${nick%>}"; printf '\a' ;; esac
case "$mesg" in *$u*) date="$(tput setaf $l)$date" ;; esac

Expand Down Expand Up @@ -108,7 +112,7 @@ tail -f -n "$h" "$i/$n/$c/out" | while read -r date time nick mesg; do
printf '\r%s %*.*s %s %s\n' "$blk$date $time$clr" "$m" "$m" "$nick" "$blk|$wht" "$mesg$rst"
done &

while read -r line; do
while IFS= read -r line; do
case "$line" in
'') continue
;;
Expand Down

0 comments on commit 4bc35ed

Please sign in to comment.