1

Split: File into multiple and keeping the same 3 lines from input into all output files

view story
linux-howto

http://www.unix.com – The following code will split the infile into multiple files. However, I need it to insert the same first 3 lines from the original input file into each splitted file. How do I modify my script below to do so: Code: print -n "Enter file name to split? " ; read infile if [ -z "$infile" ] then echo "Invalid file name entered ..." exit 255 fi print -n "Enter Number of files to split it into? " ; read numf if echo $numf | egrep -q '^[2-9]{1}$'; then echo else echo "Invalid number <$numf> entered. Entry must be numeric and 1 digits in length (HowTos)