Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!usc!wuarchive!uunet!kddlab!titcca!wnoc-tyo-news!astecgw!minmin From: minmin@astec.co.jp (Masato Minda) Newsgroups: comp.mail.mush Subject: Re: Convert mh-folders to mush Message-ID: Date: 5 Jan 91 12:15:22 GMT References: <1991Jan03.090031.5159@kub.nl> Sender: junet@astecgw.astec.co.jp Distribution: comp Organization: ASTEC, Inc. Tokyo, Japan Lines: 73 In-reply-to: wessel@kub.nl's message of 3 Jan 91 09:00:31 GMT In article <1991Jan03.090031.5159@kub.nl> wessel@kub.nl (Wessel Kraay) writes: >Does anyone know of a shell script to convert MH-folders to mush folders? I am using these shell scirpts. But ``From '' line is incorrect. MinMin #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'mhtombox' <<'END_OF_FILE' X: for i in $* do X egrep From: $i | head -1 | sed s/From:/From/ | awk '{printf "%s", $0}' X egrep Date: $i | sed -e s/,// | awk '{print " " $2 " " $4 " " $3 " " $6 " " 19 $5}' X cat $i done END_OF_FILE if test 187 -ne `wc -c <'mhtombox'`; then echo shar: \"'mhtombox'\" unpacked with wrong size! fi chmod +x 'mhtombox' # end of 'mhtombox' fi if test -f 'newstombox' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'newstombox'\" else echo shar: Extracting \"'newstombox'\" \(293 characters\) sed "s/^X//" >'newstombox' <<'END_OF_FILE' X: if [ $# = 0 ] || [ ! -f $1 ] then X echo "Usage: `basename $0` file ..." 1>&2 X exit 1 fi X for i in $* do X if test -f $i X then X head -20 $i | egrep From: | sed s/From:/From/ | awk '{printf "%s ", $0}' X date | sed 's/JST //' X cat $i X else X echo "$i: not found." 1>&2 X fi done END_OF_FILE if test 293 -ne `wc -c <'newstombox'`; then echo shar: \"'newstombox'\" unpacked with wrong size! fi chmod +x 'newstombox' # end of 'newstombox' fi echo shar: End of shell archive. exit 0 -- minmin Masato Minda ASTEC, Inc.