Question: Please help, I am stuck on Linux operating system bash shell scripting: Write the bash shell script that uses a combination of the Linux commands

Please help, I am stuck on Linux operating system bash shell scripting:

Write the bash shell script that uses a combination of the Linux commands to help summarize the data contained in an external file (cat, grep, cut, numaverage, uniq, numbound, sort, wc ) - use the man ommand to help learn more about Linux commands.

-The script has to accept the name of the external file as a command line argument

- The script has to display the total number of particles recorded in the file

-The script has to summarize the data of each unique particle species: -- dont create temporary files to store data (chain commands together with piping) -- All decimal values should be displayed to six decimal places

Name of particle species

Total number of occurrences of the species

Minimum momentum of the species

Maximum momentum of the species

Average momentum of the species

2 data files are provided to use with the BASH script small.dat and large.dat

Use the small.dat file to test and perfect the BASH script

Use the large.dat file to produce the output

ex: (using the small.dat file)

Contents sub set of the small.dat file

NEUTRON 20.900103 PION- 0.215176 PION- 22.716532 NEUTRON 8.043279 PION+ 1.374297 PION- 0.313350 PION+ 0.167848 

Summary of the complete small.dat file

Total Species: 26 Species Information: Name Count Minimum Maximum Average -------- ----- --------- --------- --------- KAON- 1 5.489958 5.489958 5.489958 NEUTRON 2 8.043279 20.900103 14.471691 PHOTON 10 0.034664 1.897264 0.652727 PION- 5 0.192247 22.716532 5.145192 PION+ 7 0.167848 7.631051 2.691639 PROTON 1 1.160216 1.160216 1.160216 

Thank you!

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!