Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 1

Quiz

Shell Scripting
I. Output tracing (4 items x 5 points)
Write the following output of each presented bash scripts

1. Output:

#!/bin/sh
# This is a comment! echo
“Aim high, STI!” echo
“This is a comment!” echo
This is a comment

2. Output:

#!/bin/sh
word1=Hello
word2=How
word3=you
word4=are
echo “$word2 $word4 $word2? $word1?!?”

3. Output:

#!/bin/sh
Name1=John
echo “Who are you?”
Name2=Michael
echo “Nice to meet you $Name1”

4. Output:

#!/bin/sh
aa=4
ab=5
ac=6
let “aa = aa + ac”
echo “The first operation is equal to $aa” let
“ac = ac - ab”
echo “The second operation is equal to $ac”

You might also like