Hour 10

1: Give an echo command to display this message:
It's <party> time!
A1: You can use double quotes as follows:
$ echo "It's <party> time!"
2: Give an echo command to display one line containing the following fields:
  • The contents of variable $USER

  • A single space

  • The word “owes”

  • Five spaces

  • A dollar sign ($)

  • The contents of the variable $DEBT (this variable contains only digits)

  • Sample output:

    fred owes     $25
    
A2: The following command will accomplish this task:
$ echo "$USER owes     \$$DEBT"

Get Sams Teach Yourself Shell Programming in 24 Hours, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.