Message-ID: <39CB3E02.FFC6D6AC@v-town.v-town.com>
From: Andrew Dennon <alex@v-town.v-town.com>
X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.16 i586)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: comp.os.minix
Subject: Re: splitting up the usr.taz file...
References: <773y5.368$aH.51834@nntp1.chello.se>
Content-Type: multipart/mixed;
 boundary="------------22223462DC976E150D8B6966"
Lines: 90
Date: Fri, 22 Sep 2000 04:09:54 -0700
NNTP-Posting-Host: 139.142.84.10
X-Trace: read1 969621175 139.142.84.10 (Fri, 22 Sep 2000 05:12:55 MDT)
NNTP-Posting-Date: Fri, 22 Sep 2000 05:12:55 MDT
Path: news.adfa.oz.au!clarion.carno.net.au!news0.optus.net.au!news1.optus.net.au!optus!intgwpad.nntp.telstra.net!news-hog.berkeley.edu!ucberkeley!news.maxwell.syr.edu!howland.erols.net!europa.netcrusader.net!206.191.82.230!prairie.attcanada.net!newsfeed.attcanada.net!142.77.1.188!news.uunet.ca!feed1.cg.sfl.net!read1!139.142.84.10!206.29.186.228
Xref: news.adfa.oz.au comp.os.minix:35814

This is a multi-part message in MIME format.
--------------22223462DC976E150D8B6966
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

"Samuel Bgfors" wrote:
> 
> Hi!
> Im trying to get Minix 2.0 to run on my OLD 386SX laptop. After installing
> the basic stuff I want to get the usr.taz file in. My problem is that the
> old computer only have a floppy and I cant figure out a way to split the taz
> file on multiple floppys from my win2000 machine. Anyone know how to do that
> in a way so that !?
> 
> // Samuel

You might need a penguin for this...
--------------22223462DC976E150D8B6966
Content-Type: text/plain; charset=us-ascii;
 name="chop"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="chop"

#!/bin/bash
# chop - Chop any file into sticks of any length (except 0).

MINMAJ="2"
MINMIN="03"
MINPAT="0"
FLAG=0
i=0
RES="0+0"
EXT="+++"
NAMETAG="name.tag"
DEFNAME="chop.stuck"
SCRIPT="chop"
VERSION="0.06"
AUTHOR="root@slug"

MINVER=${MINMAJ}${MINMIN}
THISMAJ=`echo $BASH_VERSION |cut -d "." -f 1`
THISMIN=`echo $BASH_VERSION |cut -d "." -f 2`
THISVER=${THISMAJ}${THISMIN}
if let " $THISVER < ${MINVER} ";
  then echo $SCRIPT "requires GNU bash version" ${MINMAJ}.${MINMIN}.${MINPAT}.;
  exit 1;
elif (( $# < 1 )) || [[ $1 == "-help" ]]; then
	echo "Usage: chop [-help] [-version] [-stick] file length";
	echo "       -help    = This help message.";
	echo "       -version = Print version information.";
	echo "       -stick   = Sticks a chopped file together.";
	echo "        file    = Name of the file to chop.";
	echo "        length  = Length in bytes of each stick to chop.";
	exit 0;
elif [[ $1 == "-version" ]]; then echo -e $SCRIPT $VERSION '\n'$AUTHOR; exit 0;
elif [[ $1 != "-stick" ]]; then
	if [ ! -s $1 ]; then echo "No file to chop."; exit 1;
	elif (($# < 2)) || ! (( $2 > 0 )); then echo "No stick length."; exit 1;
	else until (( $FLAG == 1 )); do
		dd if=$1 of=${i}.${EXT} bs=$2 skip=$i count=1 2>&1 |grep \
		${RES} >/dev/null;
		if (( $? == 0 )); then FLAG=1; fi;
		i=$(( $i + 1 ));
	done;
	rm ${1};
	rm $(( i - 1 )).${EXT};
	echo ${1} >$NAMETAG;
	echo ${1} "was chopped into" $(( i - 1 )) "sticks.";
	exit 0;
	fi;
else
	if [ ! -s ${i}.${EXT} ]; then echo "No chops to stick."; exit 1;
	elif [ ! -r ${NAMETAG} ]; then echo $DEFNAME >$NAMETAG; fi;
	STICKFILE=`cat $NAMETAG`
	cp ${i}.${EXT} ${STICKFILE}
	until (( $FLAG == 1 )); do
		rm ${i}.${EXT};
		i=$(( i + 1 ));
		cat ${i}.${EXT} >>$STICKFILE 2>/dev/null;
		if (( $? != 0 )); then FLAG=1; fi;
	done;
rm ${NAMETAG};
echo ${i} "chops were stuck into" ${STICKFILE}".";
exit 0;
fi
# End.

--------------22223462DC976E150D8B6966--

