Solved

endless loop in ksh

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…

932 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

10 Experts available now in Live!

Get 1:1 Help Now