topical media & game development

talk show tell print

basic-shell-app-a-exercise-02-04.sh / sh



  DIRECTORY=/usr/local
  LS=ls
  CMD="LS DIRECTORY"
  CMD     # Note how the command is executed indirectly.
  
  # Add a -1 (one) command-line option.
  DIRECTORY=/usr/local
  LS=ls
  LS_OPTS="-1"
  CMD="LS LS_OPTS DIRECTORY"
  CMD
  
  # Even more indirect script.
  DIRECTORY=/usr/local
  LS=ls
  LS_OPTS="-1"
  LS_CMD="LS LS_OPTS"
  CMD="LS_CMD DIRECTORY"
  CMD
  


(C) Æliens 20/2/2008

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.