Solved

endless loop in ksh

Posted on 1998-09-24
3
1,224 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
deburging in oracle form 12 99
Fibonacci challenge 11 122
JQuery serialize and unserialize 8 83
"Black Box" Testing of Control System Software 2 51
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
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.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

770 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