Skip to content

Latest commit

 

History

History
22 lines (14 loc) · 459 Bytes

5-3-User-Input.md

File metadata and controls

22 lines (14 loc) · 459 Bytes

5.3 User Input

5.3.2 Exercises

  1. Write a script that asks the user for an adjective, a noun, and a verb, and then use those words in a sentence (like Mad Libs).

    #!usr/bin/env bash
    # File: ex5-3-q1.sh
    
    echo -n "Enter an adjective: "
    read adj
    
    echo -n "Enter a noun: "
    read noun
    
    echo -n "Enter a verb: "
    read verb
    
    echo "Sentence: $noun $verb $adj."