LUNIX (Please label)
- This assignment continues on from the work from the lastlab. You will only workin Linux in thislab. Start your LinuxVM, open two terminal windows andcd to ~/ scripts in both.
- In one terminal window, type viscript3.sh andenter the following code(use i
to enter insert mode):
#!/bin/bash
Sum=0
forkin$@;do
Sum=$((Sum+k));done
echo The sum of the parametersis $Sum
Type to exit insertmode,:w tosave the file and in your other terminal window remember to changethe file’s permissions to be executable. Run this scriptby typing
./script3.sh 1512 20 38 16.
1) Whatis output?2)Explain how this script works.
- Modify script3.sh to compute and output the average ofthe list of
OROR