9 date 92.02.14.17.05.31; author jromine; state Exp;
14 date 92.02.13.19.07.01; author jromine; state Exp;
19 date 92.02.13.18.58.56; author jromine; state Exp;
24 date 92.02.13.18.57.46; author jromine; state Exp;
29 date 92.02.13.18.39.27; author jromine; state Exp;
34 date 92.02.13.00.01.44; author jromine; state Exp;
39 date 92.02.12.23.48.40; author jromine; state Exp;
44 date 92.02.12.23.38.59; author jromine; state Exp;
49 date 92.02.12.23.34.06; author jromine; state Exp;
54 date 92.02.12.23.33.13; author jromine; state Exp;
59 date 92.02.12.23.11.58; author jromine; state Exp;
64 date 92.02.12.22.40.02; author jromine; state Exp;
69 date 92.02.12.22.23.40; author jromine; state Exp;
74 date 92.02.12.22.16.40; author jromine; state Exp;
79 date 92.02.12.22.16.01; author jromine; state Exp;
84 date 92.02.12.22.14.05; author jromine; state Exp;
95 @make format string backward compatible
99 # packmbox - pack an MH folder back into a UUCP-style mbox
100 # @@(#)$Id: packmbox.sh,v 1.15 1992/02/13 19:07:01 jromine Exp $
103 # `+folder' defaults to current folder
104 # `msgs' defaults to all
109 # for simplicity (and speed) we don't parse command-line args (much)
111 1/-h*) echo "syntax: packmbox [+folder] [msgs] [-help]" 1>&2; exit 0;;
114 format="%(msg) From \
115 %<{return-path}%(putstr)%|\
116 %<(nonnull(mbox{from}))%(putstr)%|nobody%>@@\
117 %<(nonnull(host{from}))%(putstr)%|nowhere%>%> \
118 %(day{date}) %(month{date}) %2(mday{date}) \
119 %02(hour{date}):%02(min{date}):%02(sec{date}) \
120 %(void(year{date}))%<(gt 100)%4(putnum)%|19%02(putnum)%>"
122 trap 'rm -f /tmp/packm$$; exit 1' 1 2 3 15
124 scan -noclear -noheader -noreverse -width 256 \
125 -format "${format}" $* >/tmp/packm$$
126 # tricky -- you must do this "cd" after scan has updated the context
134 sed -e '/^From /s/^/>/' < $m
148 # @@(#)$Id: packmbox.sh,v 1.14 1992/02/13 18:58:56 jromine Exp $
151 %(putstr %<{return-path}%|%<{from}%(addr{from})%|nobody%>%>) \
162 # @@(#)$Id: packmbox.sh,v 1.13 1992/02/13 18:57:46 jromine Exp jromine $
165 %(void(year{date}))%<(gt 100)%4(putnum)%|19%2(putnum)%>"
172 Fix 2-digit dates to be "19xx".
177 # @@(#)$Id: packmbox.sh,v 1.11 1992/02/13 00:01:44 jromine Exp $
184 @Fixes from Jerry Peek
189 # @@(#)$Id: packmbox.sh,v 1.11 1992/02/13 00:01:44 jromine Exp jromine $
192 %02(hour{date}):%02(min{date}):%02(sec{date}) %4(year{date})"
196 scan -noclear -noheader -noreverse -width 256 -format "${format}" $* |
207 # @@(#)$Id: packmbox.sh,v 1.10 1992/02/12 23:48:40 jromine Exp jromine $
209 trap 'rm -f /tmp/packm$$; exit 1' 1 2 3 15
211 scan -noclear -noheader -noreverse -width 256 \
212 -format "${format}" $* >/tmp/packm$$
222 @*** empty log message ***
227 # @@(#)$Id: packmbox,v 1.9 1992/02/12 23:38:59 jromine Exp jromine $
229 # usage: packmbox [+folder] [msgs] > mbox
233 # for simplicity (and speed) we don't parse command-line args
239 @*** empty log message ***
244 # @@(#)$Id: packmbox,v 1.8 1992/02/12 23:34:06 jromine Exp jromine $
247 scan -noclear -noheader -noheader -format "${format}" $* >/tmp/packm$$
253 @*** empty log message ***
258 # $Id: packmbox,v 1.7 1992/02/12 23:33:13 jromine Exp jromine $
261 # Turn an MH folder back into a UUCP-style mbox
264 # Current-folder, `msgs' defaults to all
267 # Current-folder, and/or msg
273 @*** empty log message ***
278 # $Id: packmbox,v 1.6 1992/02/12 23:11:58 jromine Exp jromine $
285 @*** empty log message ***
290 # $Id: packmbox,v 1.5 1992/02/12 22:40:02 jromine Exp jromine $
293 # Sadly, this had to run "pick" in order to select the current
294 # folder. "scan" doesn't need an expanded list of the messages,
295 # but we need to `cd' to the selected folder.
298 msgs="`pick $* -list`"
301 scan -noclear -noheader -noheader -format "${format}" ${msgs} | (
309 @*** empty log message ***
314 # $Id: MH2Mail,v 1.4 1992/02/12 22:23:40 jromine Exp jromine $
317 # Turn an MH folder back into a UUCP-style mbox (yuk!)
320 # Note, this tries to avoid bad defaults in your .mh_profile,
321 # but may not be 100% successful.
324 # set the format string
326 %(msg) From %(putstr %<{return-path}%?{from}%(addr{from})%|nobody%>) \
329 MHCONTEXT=/dev/null; export MHCONTEXT
331 scan -noclear -noheader -noheader -format "${format}" $* | (
342 @*** empty log message ***
353 scan -noclear -noheader -noheader -format "${format}" $* | (
359 @*** empty log message ***
364 msgs="`pick $* -list`"
367 scan -noheader -format "${format}" ${msgs} | (
373 @*** empty log message ***
381 scan -noheader -format "${format}" $i
394 scan -noheader -format "${format}" ${msgs} | (