Previous Section  < Day Day Up >  Next Section

LAB 43: USING typeset

  1. Write a script that will do the following:

    1. Ask the user to type in his or her first and last name.

    2. Store the answers in two variables.

    3. Use the new ksh read command.

  2. Use the typeset command to convert the first and last name variables to all lowercase letters.

  3. Test to see if the person's name is tom jones. If it is, print Welcome, Tom Jones; if it is not, print, Are you happy today, FIRSTNAME LASTNAME?. (The user's first and last names are converted to uppercase letters.)

  4. Have the user type in an answer to the question and use the new ksh test command to see whether the answer is yes or no. If yes, have your script say something nice to him or her, and if no, tell the user to go home and give the current time of day.

  5. Rewrite the lookup script.

    1. The script will ask the user if he or she would like to add an entry to datafile.

    2. If the user answers yes or y, ask for the following input:

      
      Name
      
      Phone number
      
      Address
      
      Birth date
      
      Salary
      
      

      A variable for each item will be assigned the user input.

EXAMPLE


print –n "What is the name of the person you are adding to the file?"

read name The information will be appended to the datafile.


    Previous Section  < Day Day Up >  Next Section