Problem

In this project, you modify a while loop so it uses the test command. To modify a...

In this project, you modify a while loop so it uses the test command.

To modify a while loop to use the test command:

1. Recall the script in your home directory named colors, which you wrote in Chapter 6. It repeatedly asks the user to guess its favorite color, until the user guesses the color red. The code for the colors script is as follows (it uses a while loop until the guess variable contains the word red)

2. Load the colors script file into vi or Emacs.

3. Change the line that reads:

to this:

while test $guess != "red" ; do

4. Save the file and exit the editor.

5. Test the script. Figure 7-11 shows sample output of the program.

6. Type clear and press Enter to clear the screen.

Step-by-Step Solution

Request Professional Solution

Request Solution!

We need at least 10 more requests to produce the solution.

0 / 10 have requested this problem solution

The more requests, the faster the answer.

Request! (Login Required)


All students who have requested the solution will be notified once they are available.
Add your Solution
Textbook Solutions and Answers Search
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT