Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

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 2 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. test1 h test2as the first 100 lines from test, while has the remained 50 lines.

$./mySplit.sh test 100

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Handbook Of Database Security Applications And Trends

Authors: Michael Gertz, Sushil Jajodia

1st Edition

1441943056, 978-1441943057

More Books

Students also viewed these Databases questions