Miscellaneous

  Home arrow Miscellaneous arrow Loops in the UNIX Shell
MISCELLANEOUS

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

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

  •  
     

    SEARCH CODEWALKERS

    TOOLS YOU CAN USE

    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

    blog comments powered by Disqus

    MISCELLANEOUS ARTICLES

    - Oracle Database XE: Indexes and Sequences
    - Modifying Tables in Oracle Database XE
    - Oracle Database XE: Tables and Constraints
    - More on Oracle Databases and Datatypes
    - Oracle Database XE Datatypes: Datetime and L...
    - Oracle Database XE Datatypes: Character and ...
    - From Databases to Datatypes
    - Firefox 3.6.6 Released with Improved Plug-in...
    - Attention Bloggers: WordPress 3.0 Now Releas...
    - Reflection in PHP 5
    - Inheritance and Other Advanced OOP Features
    - Advanced OOP Features
    - Linux from Scratch V.6.6 Review
    - Linux Gaining in Strength
    - Install Slackware on Your Old PC


    © 2003-2012 by Developer Shed. All rights reserved. DS Cluster 4 - Follow our Sitemap