Linux Basic Scripting [time sensitive] What commands will we use for the followi
ID: 3784023 • Letter: L
Question
Linux Basic Scripting [time sensitive]
What commands will we use for the following instances:
a)
File1:
Name LastName GPA ID Balance
Fred Johnson 3.5 1 $1250
John Carlton 4.0 2 $3250
File2:
City Phone Email ID
San Francisco 415-222-333 fred at ymail.com 1
San Jose 408-333-2121 steve at xmail.com 2
Use cut and paste commands to have the LastName, phone and email of all students in one file.
b)
Write a script to clear the screen, move the cursor to location 10, 12 and display:
Enter number1:
Enter number2:
Enter number3:
Sum =
Average =
Move the cursor to appropriate locations and read the three numbers. Then calculate the sum and average and display them at appropriate locations.
Explanation / Answer
echo Enter four integers with space between read a b c d sum=`expr $a + $b + $c + $d` avg=`expr $sum / 4` dec=`expr $sum % 4` dec=`expr ( $dec * 1000 ) / 4` product=`expr $a * $b * $c * $d` echo Sum=$sum echo Average=$avg.$dec echo Product=$product
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.