Predict the output of the following code.

#!/bin/bash

name="Hans"

case `test $name == "hans"` in

0) echo "The name is Hans";;

1) echo "The name is not Hans";;

*) echo "The name is not known;;

esac

The name is not Hans

The name is Hans

The name is not known

test expression cannot be used with case statement

Verified Answer
Correct Option - c

To get all Self Assessment - Introduction to Unix Exam questions Join Telegram Group https://rebrand.ly/lex-telegram-236dee

Telegram

We're passionate about offering best placement materials and courses!! A one stop place for Placement Materials. We daily post Offcampus updates and Placement Materials.

Qtr No. 213, New Town Yehlanka Indore 454775

admin@prepflix.in

Updated on Thu, 11 Dec 2025