Miscellaneous
  Home arrow Miscellaneous arrow Loops in the UNIX Shell
Codewalker Forums 
  Tutorials  
Database Articles  
Miscellaneous  
Navigation Usability  
PEAR Articles  
Programming Basics  
Server Administration  
XML Tutorials  
  Reviews  
Database Book Reviews  
Linux Book Reviews  
Miscellaneous Reviews  
PHP Book Reviews  
PHP Software Reviews  
Server Admin Reviews  
SQL Tool Reviews  
  Code Gallery  
Content Management Code  
Contest Code  
Counters Code  
Database Code  
Date Time Code  
Discussion Board Code  
Email Code  
File Manipulation Code  
GUI Code  
Link Farm Code  
Miscellaneous Code  
Search Code  
Site Navigation Code  
User Management Code  
Mobile Linux 
App Generation ROI 
IBM® developerWorks 
Download TestComplete 
Forums Sitemap 
Weekly Newsletter 
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MISCELLANEOUS

Loops in the UNIX Shell
By: Gabor Bernat
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 4
    2009-05-27

    Table of Contents:
  • Loops in the UNIX Shell
  • The loops
  • More loops
  • Controlling the loops

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Loops in the UNIX Shell


    (Page 1 of 4 )

    History is repeating itself. How many times have you heard this? Unless you live isolated inside of a cave on a mountain top, with no information source around, you've probably heard this countless times. But never mind history; you've probably found that it would be convenient to make your computer repeat the same tasks over and over. Within a programming language, we refer to this structure as a loop.

    This article is part of the series I write related to shell programming. From this, you can already conclude that today if you stick with me until the end you will learn all about loops in the UNIX shell programming.

    As you may have already figured out, I will not start from the very beginning of this guide. I already covered a couple of interesting aspects of UNIX and shell programming in the earlier articles.

    If you missed any one of them, you should suspend reading this article for now and read them first. It is almost pointless to start from the middle of a language. First, you need to know the basics.

    For this article, you will need the basic concept of how a command works. Notions such as the echo command, the use of a text editor inside a terminal and how to work with a terminal are prerequisites if you plan to understand this article.

    In my first article about UNIX shell control mechanisms, I explained that you need two basic structures for a programming language: the decision making and the loop. In the previous two articles, I covered the decision making well enough.

    So the time has arrived for me to present the loop to you. There are three types of loops in the shell programming: the "for," the "while" and the "until."

    More Miscellaneous Articles
    More By Gabor Bernat


     

    MISCELLANEOUS ARTICLES

    - Using PHP to Stream MP3 Files and Prevent Il...
    - 10 Must Have Firefox Improvements
    - All About OpenOffice 3.0
    - Shell Script Writing
    - Loops in the UNIX Shell
    - The Test in the UNIX Shell
    - Data Streams and the UNIX Shell
    - Control Mechanisms of the UNIX Shell
    - Variables Within the UNIX Shell
    - The Shell and UNIX
    - In Detail: UNIX File Systems
    - Rights Management in UNIX
    - UNIX File Systems
    - The Terminal in UNIX
    - Operating Systems and UNIX





    © 2003-2009 by Developer Shed. All rights reserved. DS Cluster 2 Hosted by Hostway
    For more Enterprise Application Development news, visit eWeek