From: inamura@icot.or.jp (INAMURA =JANE= You)
Newsgroups: fj.mail
Subject: Re: /bin/mail -d (Re: [MH] print number of lines)
Date: 20 Aug 92 03:01:59 GMT
	<1992Aug12.160401.4553@iris.is.tsukuba.ac.jp>
	<1992Aug18.163025.4563@iris.is.tsukuba.ac.jp>
Organization: Institute for New Generation Computer Technology, Tokyo, Japan

>>In article <1992Aug18.163025.4563@iris.is.tsukuba.ac.jp>,
>>	yas@softlab.is.tsukuba.ac.jp (Yasushi Shinjo) writes:

YS> /usr/ucb/sendmail $B$NBe$o$j$K!"(B/bin/mail $B$r8F=P$9J}K!$b$"$k$H(B
YS> $B;W$$$^$9!#(B

YS> 	"| script | /bin/mail -d inamura"

YS> $B$G$7$g$&$+!#(B/bin/mail -d $B$N>l9g!"%P%C%/%9%i%C%7%e$rIU$1$J$/(B
YS> $B$F$b$$$$$H;W$$$^$9!#(B

$B$X$'!"$3$&$$$&%*%W%7%g%s$,$"$C$?$s(B$B$G$9$+!#A4A3CN$j$^$;$s$G$7(B
$B$?!#$o$?$7<+?H$O<B:]$K$O(B

	"| script | slocal"

$B$7$F$^$9$N$G!":#$N$H$3$m$"(B$B$^$jI,MW$r46$8$^$;$s$,!"$$$:$l2?$+(B
$B$G;H$&$3$H$b$"$j$=$&$J$N$G3P$($F$*$-$^$9!#$I$&$b$G$9!#(B(_ _)

$B"t$3$N(B$B$h$&$JJ}K!$@$H!"(B Lines: $B$NA^F~$N$h$&$KA4BN$K6&DL$7$?=h(B
$B"tM}$O(B script $B$NCf$G!"8D!9$N%a!<%k$NB0@-Kh$KI,(B$BMW$J=hM}$O(B slocal
$B"t$+$i99$K8F$P$l$k(B filter $B$NCf$G!"$H$$$&$h$&$J@Z$jJ,$1$,$G$-(B
$B"t$k$?$a7k9=JXMx$G$9!#(B


> $BF1$8$h$&$J$3$H$r<B:]$K$d$C$F$^$9$N$G!"$3$N$?$a$N(B script $B$O;}$C(B
> $B$F$^$9$+$i6=L#$,$*$"$j$G$7$?$i:9(B$B$7>e$2$^$9(B $B!d(B $B855-;v$N:n<T$5$^(B
YS> $B$h$m$7$1$l$P!"%]%9%H$7$F$b$i$($^$;$s$+!)!!;d$b6=L#$,$"$j$^$9(B
YS> $B$7(B$B!";d$NB>$K$b6=L#$r;}$D?M$,Bg@*$$$i$C$7$c$k$H;W$&$N$G$9!#(B

$B$=$l$8$c>.$5$J$b$N$G$9$+$i!"$*8@MU$H$*$jN.$7(B$B$A$c$$$^$7$g$&!#(B
$BAF(B script $B$G$9$,!#(B(^_^;)

$B"t$b$&0l$D!"<+J,$G;H$C$F$$$k(B Lines: $B$KBP1~$7$?(B scan format file
$B"t$b!"2?$+$N;29M$K$J$l$P$H$$$&$3$H$GIU$1$F$*$-$^$9$N$G!#8f>^(B
$B"tL#2<$5$$$^$;!#(B


$B0pB<!w#I#C#O#T(B

--- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< --
#! /bin/sh
TMP=/tmp/lines$$
TMPTMP=/tmp/linesss$$
AWK=/usr/bin/awk
SED=/bin/sed
TEE=/bin/tee
CAT=/bin/cat
WC=/bin/wc
GREP=/bin/grep
RM=/bin/rm

LEN=`$CAT | $TEE $TMP | $SED '1,/^$/d' | $WC -l`
$SED '/^$/q' < $TMP | $SED '/^$/d' | $TEE $TMPTMP | $GREP -s "^Lines: "\
		 > /dev/null ||\
		 echo "Lines:" $LEN >> $TMPTMP
echo "" >> $TMPTMP
$SED '1,/^$/d' < $TMP | $CAT $TMPTMP -

$RM $TMP
$RM $TMPTMP
--- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< ----- 8< --
%5(msg):%<(cur)+%| %>%<{replied}-%| %>\
%(void(rclock{date}))\
%<(gt 15768000)%03(month{date})%02(year{date})%|\
%<(gt 604800)%02(mon{date})/%02(mday{date})%|\
%<(gt 86400) %(day{date}) %|\
%02(hour{date}):%02(min{date})%>%>%>\
%<{date} %|*%>\
%(void(mymbox{from}))%(void(friendly{to}))\
[%<{lines}%(void(compval{lines}))%|%(void(size))%>\
%<(gt 9999)%<{lines}%5(compval{lines})%|%5(size)%>:\
%<(mymbox{from})To %9(friendly{to})%|%12(friendly{from})%>%|\
%<(gt 999)%<{lines}%4(compval{lines})%|%4(size)%>:\
%<(mymbox{from})To %10(friendly{to})%|%13(friendly{from})%>%|\
%<(gt 99)%<{lines}%3(compval{lines})%|%3(size)%>:\
%<(mymbox{from})To %11(friendly{to})%|%14(friendly{from})%>%|\
%<(gt 9)%<{lines}%2(compval{lines})%|%2(size)%>:\
%<(mymbox{from})To %12(friendly{to})%|%15(friendly{from})%>%|\
%<{lines}%1(compval{lines})%|%1(size)%>:\
%<(mymbox{from})To %13(friendly{to})%|%16(friendly{from})%>%>%>%>%>]\
%<{subject} %{subject}%| (NONE)%>%<{body} <<%{body}%>