Solved

endless loop in ksh

Posted on 1998-09-24
3
1,200 Views
Last Modified: 2013-12-26
i have a ksh script like this:

#!/bin/ksh

for i in 1 2 3 4 5 6 7 8 9 10
do
something
done

now i want it loop endless when i value is from 1 to 10, so i add a loop like this:

#!/bin/ksh

loop:

for i in 1 2 3 4 5 6 7 8 9 10
do
something
done
goto loop

but this didn't work.how to make it work?
0
Comment
Question by:smiley020999
3 Comments
 
LVL 84

Expert Comment

by:ozo
ID: 1293418
while [ 1 ] ; do
    for i in 1 2 3 4 5 6 7 8 9 10
    do
        echo $i
    done
done
0
 
LVL 2

Expert Comment

by:kellyjj
ID: 1293419
ozo pretty much hit it on the head.  
0
 

Accepted Solution

by:
drosseel earned 50 total points
ID: 1293420
while true
do
   for i in 1 2 3 4 5 6 7 8 9 10
      do
         echo $i
      done
done
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now