Purchase Solution

A demonstration of various unix shell commands

Not what you're looking for?

Ask Custom Question

Copy the following shell that completes the following:

#!/bin/bash
echo Select a country from the following list:
echo America, Italy, France, Germany
read country

case $country in
[Aa]merica ) echo Ford; echo Perhaps;;
[Ii]taly ) echo Ferarri;echo no;;
[Ff]rance ) echo Peugeot ;echo no way;;
[Gg]ermany ) echo Porsche ;echo yes;;

esac

Run the shell from above.

Answer the following questions:
- What is the purpose of the echo command?
- In the case statement, why are the first letters both caps and lower case?
- What does esac mean?

Create your own shell that completes the following problem:
- Ask the user their name.
- Compare it to your name.
- Give a reply that their response is either your name too or it is a nice name too.

Purchase this Solution

Solution Summary

In this solution I provide an explanation of the commands found in a simple shell script. I also write a new shell script that prompts the user for their name and prints a message.

Solution Preview

The echo command is used to print something to the screen. In this case it is printing a prompt that is asking the user to enter their country.

The first letters of each case in the case statement are enclosed in square brackets ([]) this means that either letter is accepted as a match. Since both an upper and lower case letter are in each ...

Purchase this Solution


Free BrainMass Quizzes
Word 2010: Tables

Have you never worked with Tables in Word 2010? Maybe it has been a while since you have used a Table in Word and you need to brush up on your skills. Several keywords and popular options are discussed as you go through this quiz.

C# variables and classes

This quiz contains questions about C# classes and variables.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.

Basic Computer Terms

We use many basic terms like bit, pixel in our usual conversations about computers. Are we aware of what these mean? This little quiz is an attempt towards discovering that.

Javscript Basics

Quiz on basics of javascript programming language.