1177448Sdes#!/bin/sh
2177448Sdes#-
3177448Sdes# Copyright (c) 2008 Dag-Erling Co��dan Sm��rgrav
4177448Sdes# All rights reserved.
5177448Sdes#
6177448Sdes# Redistribution and use in source and binary forms, with or without
7177448Sdes# modification, are permitted provided that the following conditions
8177448Sdes# are met:
9177448Sdes# 1. Redistributions of source code must retain the above copyright
10177448Sdes#    notice, this list of conditions and the following disclaimer
11177448Sdes#    in this position and unchanged.
12177448Sdes# 2. Redistributions in binary form must reproduce the above copyright
13177448Sdes#    notice, this list of conditions and the following disclaimer in the
14177448Sdes#    documentation and/or other materials provided with the distribution.
15177448Sdes#
16177448Sdes# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
17177448Sdes# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18177448Sdes# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19177448Sdes# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
20177448Sdes# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
21177448Sdes# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
22177448Sdes# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23177448Sdes# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
24177448Sdes# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
25177448Sdes# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26177448Sdes# SUCH DAMAGE.
27177448Sdes#
28177448Sdes# $FreeBSD$
29177448Sdes#
30177448Sdes
31177448Sdestail -10000 -F "$@" |
32177448Sdeswhile read line
33177448Sdesdo
34177448Sdes	case $line in
35177448Sdes	\>\>\>*)
36177448Sdes		endl="\r\n"
37177448Sdes		;;
38239927Sdes	\*\*\**)
39177448Sdes		endl="\r\n"
40177448Sdes		;;
41177448Sdes	\=\=\=*)
42177448Sdes		endl="\r"
43177448Sdes		;;
44177448Sdes	*)
45177448Sdes		continue
46177448Sdes		;;
47177448Sdes	esac
48177448Sdes	printf "%s%*s${endl}" "${line}" $((${COLUMNS:-80} - ${#line} - 1)) " "
49177448Sdesdone
50