Example script: ex1.ksh


   1: #!/bin/ksh
   2: # For the purposes of display, parts of the script have 
   3: # been rendered in glorious technicolor.
   4: ## Some comments are bold to flag special sections
   5: 
   6: # Line numbers on the left are not part of the script.
   7: # They are just added to the HTML for reference.
   8: 
   9: # Built-in commands and keywords (e.g. print) are in blue
  10: # Command substitutions are purple. Variables are black
  11: print "Disk usage summary for $USER on `date`"
  12: 
  13: # Everything else is red - mostly that is external 
  14: # commands, and the arguments to all of the commands.
  15: print These are my files       # end of line comment for print
  16: # List the files in columns
  17: ls -C
  18: # Summarize the disk usage
  19: print
  20: print Disk space usage
  21: du -k 
  22: exit 0



  last modified 22/03/2012 Introduction Table of Contents
(frame/no frame)
Printable
(single file)
© Dartmouth College