Lunix Please Label Assignment Continues Work Last Lab Workin Linux Lab Start Linuxvm Open Q37108301

LUNIX (Please label)

  1. 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.
    1. 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.

  1. Modify script3.sh to compute and output the average ofthe list of
    OR
    OR

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.