[index] [text page] [<<start] [<prev] [next>] [last>>]
Page 40: For Loop

Page 40

  
  For Loop
  The for loop
  Great for operating on a list of things (files, etc)
  Example:
      $ cd /home
      $ for user in *
      > do
      >    sudo chown -R $user:$user /home/$user
      > done
  If/Else blocks and while/until/select loops exist too.

Copyright 2005, Bri Hatch of Onsight, Inc.

Presented at LFNW - LinuxFest Northwest, Bellingham, Washington, Apr 2005

Presentation created using vim and MagicPoint.