You know there are split (binary) program under linux that can split your file (binary or text) into some file with option you can pass to. I am not going to discuss it. and to combine them you can use cat program, I am not going to discuss it either. but you can search the google how to use split and combine the splitted file with cat.
And now my problem is I need to split a file then combine them using the same option over and over which make me bored. That''s why I created this small shell script which split the file, remove the file and automatically create another shell script to combine the splitted file.
The script will split the input file into smaller file (1 MB each) in this case so I can copy the file into floppy disk, you can change the split parameter on this line:
split -d -b 1000000 $1 $1.
I assume 1MB is 1 million byte to change it just change 1000000 with other number you want.
usage example:
$ ./xsplit.sh myfile.tar.gz
then it will create the following file
myfile.tar.gz.00
myfile.tar.gz.01
myfile.tar.gz.02
..
myfile.tar.gz.99
joinmyfile.tar.gz.shx
myfile.tar.gz.md5
myfile.tar.gz.00 until myfile.tar.gz.99 is the splitted file. myfile.tar.gz.md5 is the md5sum of the original file which needed for checking the integrity of the file after combined. joinmyfile.tar.gz.shx is the shell script for combining file myfile.tar.gz.00 until myfile.tar.gz.99
To join those file run
$ ./joinmyfile.tar.gz.shx
Below is the script:
[ more.. ]
