2 # packmbox - pack an MH folder back into a UUCP-style mbox
3 # @(#)$Id: packmbox.sh,v 1.16 1992/02/14 17:05:31 jromine Exp $
6 # `+folder' defaults to current folder
7 # `msgs' defaults to all
12 # for simplicity (and speed) we don't parse command-line args (much)
14 1/-h*) echo "syntax: packmbox [+folder] [msgs] [-help]" 1>&2; exit 0;;
18 %<{return-path}%(putstr)%|\
19 %<(nonnull(mbox{from}))%(putstr)%|nobody%>@\
20 %<(nonnull(host{from}))%(putstr)%|nowhere%>%> \
21 %(day{date}) %(month{date}) %2(mday{date}) \
22 %02(hour{date}):%02(min{date}):%02(sec{date}) \
23 %(void(year{date}))%<(gt 100)%4(putnum)%|19%02(putnum)%>"
25 trap 'rm -f /tmp/packm$$; exit 1' 1 2 3 15
27 scan -noclear -noheader -noreverse -width 256 \
28 -format "${format}" $* >/tmp/packm$$
29 # tricky -- you must do this "cd" after scan has updated the context
37 sed -e '/^From /s/^/>/' < $m