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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started