You mean something like this ? This is real cheesy with no error checking
to speak of but it is easy to hack in... :-)
-------------------------------
#!/bin/sh
USAGE="$0 filename #parts"
case $# in
2) ;;
*) echo $USAGE; exit 1;;
esac
#
# size the file
#
lines=`wc -l $1 | awk '{ print $1 }'`
numlines=`expr $lines / $2`
#
# Alert the user.
#
echo $1 being split in to $2 parts with $numlines lines each
#
# doit leaving the split files in $1aa, $1ab ...
#
split -$numlines $1 $1
ls -l $1*
-------------------------------
-Kent+
-- Kent Landfield INTERNET: kent_landfield@sterling.com Sterling Software UUCP: uunet!kent || sparky!kent Phone: (402) 291-8300 FAX: (402) 291-4362 Please send comp.sources.misc-related mail to kent@uunet.uu.net.
[
Usenet Hypertext FAQ Archive |
Search Mail Archive |
Authors |
Usenet
]
[
1993 |
1994 |
1995 |
1996 |
1997
]
© Copyright The Landfield Group, 1997
All rights reserved