Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

continue(1t) [opensolaris man page]

continue(1T)						       Tcl Built-In Commands						      continue(1T)

__________________________________________________________________________________________________________________________________________________

NAME
continue - Skip to the next iteration of a loop SYNOPSIS
continue _________________________________________________________________ DESCRIPTION
This command is typically invoked inside the body of a looping command such as for or foreach or while. It returns a TCL_CONTINUE code, which causes a continue exception to occur. The exception causes the current script to be aborted out to the innermost containing loop command, which then continues with the next iteration of the loop. Catch exceptions are also handled in a few other situations, such as the catch command and the outermost scripts of procedure bodies. EXAMPLE
Print a line for each of the integers from 0 to 10 except 5: for {set x 0} {$x<10} {incr x} { if {$x == 5} { continue } puts "x is $x" } SEE ALSO
break(1T), for(1T), foreach(1T), return(1T), while(1T) KEYWORDS
continue, iteration, loop ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +--------------------+-----------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +--------------------+-----------------+ |Availability | SUNWTcl | +--------------------+-----------------+ |Interface Stability | Uncommitted | +--------------------+-----------------+ NOTES
Source for Tcl is available on http://opensolaris.org. Tcl continue(1T)

Check Out this Related Man Page

for(n)							       Tcl Built-In Commands							    for(n)

__________________________________________________________________________________________________________________________________________________

NAME
for - ``For'' loop SYNOPSIS
for start test next body _________________________________________________________________ DESCRIPTION
For is a looping command, similar in structure to the C for statement. The start, next, and body arguments must be Tcl command strings, and test is an expression string. The for command first invokes the Tcl interpreter to execute start. Then it repeatedly evaluates test as an expression; if the result is non-zero it invokes the Tcl interpreter on body, then invokes the Tcl interpreter on next, then repeats the loop. The command terminates when test evaluates to 0. If a continue command is invoked within body then any remaining commands in the current execution of body are skipped; processing continues by invoking the Tcl interpreter on next, then evaluating test, and so on. If a break command is invoked within body or next, then the for command will return immediately. The operation of break and continue are similar to the corresponding statements in C. For returns an empty string. Note: test should almost always be enclosed in braces. If not, variable substitutions will be made before the for command starts execut- ing, which means that variable changes made by the loop body will not be considered in the expression. This is likely to result in an infinite loop. If test is enclosed in braces, variable substitutions are delayed until the expression is evaluated (before each loop iter- ation), so changes in the variables will be visible. For an example, try the following script with and without the braces around $x<10: for {set x 0} {$x<10} {incr x} { puts "x is $x" } SEE ALSO
break, continue, foreach, while KEYWORDS
for, iteration, looping Tcl for(n)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to define two variable in foreach command??

Hello, I just want to know how If it's possiple to define 2 variable using foreach command ??? I have directory inside that directory around 1000 file, I want to rename all of this files to something I have it in a list. Example :- ------This is what in my directory---------- d1 d2... (14 Replies)
Discussion started by: geoquest
14 Replies

2. Shell Programming and Scripting

never ending loop

Guys I have a script like the one below. One script executes another script in a loop. but i want the other script within the main script to be executed only 3 times. the script within the main script again references the main script after its execution. plz help. while } ] do... (21 Replies)
Discussion started by: ragha81
21 Replies

3. Shell Programming and Scripting

changing filenames in a directory to a number within a loop

hey guys. i'm new to shell scripting but not new to programming. i want to write a script that will take all the files in the current directory that end with a particular filetype and change all their names to a number in order. so, it would take all the jpg files and sort them in alphabetical... (30 Replies)
Discussion started by: visitorQ
30 Replies

4. UNIX for Dummies Questions & Answers

Help required on AWK command

I have two questions: (Q1) I am using a loop and want to print a particular field of a table using the AWK command by accessing one row at a time by validating NR with the loop counter. I am using a command like this but it isn't working! count=1 NAWK -F"|" -v var=$count 'NR == var { printf... (13 Replies)
Discussion started by: udiptya
13 Replies

5. Shell Programming and Scripting

Unzip in bash script

My script works like this. 1. First for loop - checks if it can access zip parameters in a directory 2. If unzip fails for any of the file in that directory, then it goes inside the second for loop - to list which file is that 3. My doubt is..Is there any way I can tell status for every 5000... (17 Replies)
Discussion started by: vidhyamirra
17 Replies

6. Shell Programming and Scripting

Shell script help

Hi guys - I have written this script to search for a file (mytest.txt) in the pwd. I was wondering how to: 1. Implement multiple file directories inside the script 2. Implement the file name inside the script currently i run it as ./script_name.sh (file to search) #!/bin/bash #... (37 Replies)
Discussion started by: DallasT
37 Replies

7. Shell Programming and Scripting

Very Basic Question regarding "while" loop

Hi, I have a loop like this - while read item do // fire insert query done < itemList.txt The itemList.txt has say, 1000 records. Now what I do is that rhough another program, I make the itemList.txt EMPTY, but still the INSERT query keeps firing the sequence of records. ... (18 Replies)
Discussion started by: angshuman_ag
18 Replies

8. Shell Programming and Scripting

Testing for EOF during a while loop

I'm a complete UNIX newbie trying to write a simple shell script. The pseudo-code for the part I'm having trouble with is as such: read something while ; do this The loop terminates at EOF (like when Ctrl+D is pushed) and displays the number of lines the user entered (kept in the loop as a... (17 Replies)
Discussion started by: Sovereign110
17 Replies

9. Shell Programming and Scripting

While-read and if-elif

Hi there, new to this forum and I recently encounter this problem: I tried to use if-elif loop in a while-read loop, something like this: #!/bin/bash while read myline1 myline2 do if ; then echo "Successful!" elif ; then echo "Failed" fi done < $1 Input file looks like this: 200... (13 Replies)
Discussion started by: kennethtls
13 Replies

10. Shell Programming and Scripting

awk easy question

So, I have the following code: cat testfile.txt | awk -F, '{ print $1" "$2" "$3" "$4" "$5 }' | read DOC ORG NAME echo "$DOC" echo "$ORG" echo "$NAME" My testfile.txt looks something like the following: Document Type,Project Number,Org ID,Invoice Number It will eventually be more... (14 Replies)
Discussion started by: Parrakarry
14 Replies

11. UNIX for Dummies Questions & Answers

Redirecting stdout inside a loop

hi, OK. I am writing a bash script, and it is almost working for me. Problem 1: I currently have stout sent to a file (stout.miRNA.bash.$date_formatted) which I would like to have work inside my loop, but when I move it, it just prints to the screen. Problem 2: I have a second file... (18 Replies)
Discussion started by: hmortens
18 Replies

12. Shell Programming and Scripting

Remove extension in loop

Dear all sorry for bothering you wityh dumb question but I am stucked with an issue. Well, I am trying to loop over files in folder, make an operation and rewrite the output. Example: INPUT file1.txt file2.txt file3.txtMy command (doesn't work!!) for file in /path/to/*.txt do command... (13 Replies)
Discussion started by: giuliangiuseppe
13 Replies

13. Shell Programming and Scripting

Loop iteration with two variables

Hello, I have been stuck on this for some time and invested many hours trying to find a solution. I am trying to either loop through two variables or or two arrays and not sure how to do it. I am limited to ksh only, and don't have the ability to do a foreach, or for i AND for j etc...I... (19 Replies)
Discussion started by: Decoy Octopus88
19 Replies

14. Shell Programming and Scripting

[bash] Zenity loop (raspbian)

Hello folks, I have created a GUI but i face some issue with the loop either i am stuck in the loop or it close the program In the code below it work fine for the "go to menu" if i press cancel i go back to the main menu but for "test" i m stuck in the menu Appreciate some help :/... (13 Replies)
Discussion started by: flammeur
13 Replies

15. Shell Programming and Scripting

Help with While loop using if else

Hi , I am executing a while loop .The only condition is , as far as the cumulative sum of the 2nd column from each line passed from the txt file reaches value of 12 , echo those lines .But once the cumulative sum reaches 12 , restart the loop setting the cumulative sum variable to 0 . But in the... (17 Replies)
Discussion started by: paul1234
17 Replies