Question: 2) Write a Bourne Shell script called mySplit.sh (which simulates the GNU utility split) to split a large file into multiple smaller files on every

 2) Write a Bourne Shell script called "mySplit.sh" (which simulates the

2) Write a Bourne Shell script called "mySplit.sh" (which simulates the GNU utility split) to split a large file into multiple smaller files on every n lines. The filename of new file is created by putting an index (starting from 1) after the original filename. When running the shell script, the first argument should be the pathname of the file to be split, the second argument should be the value of n. Note: please do not use existing utility split in your code. For example, file test (in current working directory) has 150 lines, after running command below, two new files test1 and test2 are generated in current working directory. testl has the first 100 lines from test, while test2 has the remained 50 lines. $. /mySplit.sh test 100

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!