Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
date          # Calling the date command just displays date/time information
echo date     # Here "date" is treated as a literal word, and written to output
echo `date`   # The date command is evaluated and its output replaces the command

today=$( date );          echo $today  # environment variable "today" is assigned today's date
today="Today is: `date`"; echo $today  # "today" is assigned a string including today's date

Exercise 3-5

How would you output this text using a command to calculate the number of lines: The haiku.txt file has 11 lines

...