continue(n) Tcl Built-In Commands continue(n)
__________________________________________________________________________________________________________________________________________________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.
SEE ALSO
break(n), for(n), foreach(n), while(n)
KEYWORDS
continue, iteration, loop
Tcl continue(n)
Check Out this Related Man Page
foreach(n) Tcl Built-In Commands foreach(n)
__________________________________________________________________________________________________________________________________________________NAME
foreach - Iterate over all elements in one or more lists
SYNOPSIS
foreach varname list body
foreach varlist1 list1 ?varlist2 list2 ...? body
_________________________________________________________________DESCRIPTION
The foreach command implements a loop where the loop variable(s) take on values from one or more lists. In the simplest case there is one
loop variable, varname, and one list, list, that is a list of values to assign to varname. The body argument is a Tcl script. For each
element of list (in order from first to last), foreach assigns the contents of the element to varname as if the lindex command had been
used to extract the element, then calls the Tcl interpreter to execute body.
In the general case there can be more than one value list (e.g., list1 and list2), and each value list can be associated with a list of
loop variables (e.g., varlist1 and varlist2). During each iteration of the loop the variables of each varlist are assigned consecutive
values from the corresponding list. Values in each list are used in order from first to last, and each value is used exactly once. The
total number of loop iterations is large enough to use up all the values from all the value lists. If a value list does not contain enough
elements for each of its loop variables in each iteration, empty values are used for the missing elements.
The break and continue statements may be invoked inside body, with the same effect as in the for command. Foreach returns an empty string.
EXAMPLES
The following loop uses i and j as loop variables to iterate over pairs of elements of a single list. set x {} foreach {i j} {a b c d e f}
{
lappend x $j $i } # The value of x is "b a d c f e" # There are 3 iterations of the loop.
The next loop uses i and j to iterate over two lists in parallel. set x {} foreach i {a b c} j {d e f g} {
lappend x $i $j } # The value of x is "a d b e c f {} g" # There are 4 iterations of the loop.
The two forms are combined in the following example. set x {} foreach i {a b c} {j k} {d e f g} {
lappend x $i $j $k } # The value of x is "a d e b f g c {} {}" # There are 3 iterations of the loop.
SEE ALSO
for(n), while(n), break(n), continue(n)
KEYWORDS
foreach, iteration, list, looping
Tcl foreach(n)
Guys,
Any idea how to continue suspended job in background ?
ihave tried to use the bg% command <root> but it doesnt work.
unix> jobs
+suspended du > usage
-suspended (sleep 60; date)
unix> bg %2
(sleep 60; date)
But my suspended work doesnt seems to continue run in background.. Any... (6 Replies)
Hello All,
I am trying to write a script that will only continue executing my script if a file exits. I know the directory of the file, so its just a matter of seeing if the file exists yet. If the file has not yet been created, I want the script to wait 10 minutes (600 seconds) and try again.... (7 Replies)
The following code for search a pattern in file name (or entire file name) and look at its size, code is derived from an ebook about scripting. It is working in HP Unix but I am unable to run in Linux (Ubuntu) Please advise me what is wrong for Linux?
And besides , how can I get rid of errors in... (7 Replies)
How can I get a script to complete a update, varifiy completion, resboot, and continue with script?
Is it possbile to get script to add itself to the "startup application" list
#!/bin/bash
clear
sudo apt-get update
#Verify/test the update completed
#Reboot
#Start/comtinue... (9 Replies)
Hi there,
I'm not really stranger to Linux and shell scripting but I am to servers. Anyway, I usually run scripts on a shared science machine, accessible via ssh.
My scripts are usually run with mpi, e.g.
mpirun -np 16 ./my_script
the things after entering the science machine and running... (6 Replies)
Is there a way to do this?
while getopts "n:g:m:i:p:d:a:" OPTION
do
case $OPTION in
...
if i do a ./script.sh -n john -u user -p password, it will output:
name= john
./script.sh: illegal option -- u
Is there a way to skip over errors so that -p will get processed as well?
By... (7 Replies)
Hello,
Is ther any way to run a loop which promt an echo"waiting for user to hit ENTER"
sleeps for an iterval and once user hit the ENTER key the loop exit and the script continue to the next stage?
I need this ASAP !!!
Thanks!! (9 Replies)
the below code will search attr string inside makefile under the modelno on given path.
echo "Enter model no for searching string inside makefile"
read inputs2
#find /pools/home_unix/sapte/work/models/model/$inputs2 -name "makefile" | xargs grep "attr" \;
#;;I am getting below error.... (7 Replies)
Hi This is continuation of previos thread
status=running
username=abc
password=123456
server=linux
The script was made which is used to capture the data from file
./scr test status
It will give result running
I have a case like
status = running
username=abc
password=123456... (14 Replies)
hi all,
i want to make a bash script so it can monitor directory sizes ie if it stays the same size (for a certain time) i want it to run the script but if there still copying and the directory increases in size do not run the script
i have heard "inotifywait" can do this, but theres... (7 Replies)
Hello,
We have Windows 10 machine connected to Sparc T5440 server via serial cable.
We access the server from the Windows 10 machine using putty via serial connection. This allows us to access ILOM and Unix.
We have recently noticed that whenever we reboot the windows machine (Windows 10),... (11 Replies)
I have a case statement. IS "continue" working in case?
for file in ls dir/*
case $file in
a)
do something
continue
;;
b)
do something
continue
;;
esac
It is a Bourne shell (13 Replies)
I apologize in advance, but I continue to have trouble searching for matches between two files and then printing portions of each to output in awk and would very much appreciate some help.
I have data as follows:
File1
PS012,002 PRQ 0 1 1 17 1 0 -1 3 2 1 2 -1 ... (7 Replies)
Hello Everyone,
As a fairly new user, I am attempting to better my Linux skills. Operating in Ubuntu has thus far been a fairly easy process, but I am having some trouble learning how to use the grep command. I have a series of .txt files and need identify which of the .txt files contain the... (7 Replies)
Hi all,
I have a EFI disk and it is use in zfs pool.
partition> p
Volume: rpool
Current partition table (original):
Total disk sectors available: 1172107117 + 16384 (reserved sectors)
Part Tag Flag First Sector Size Last Sector
0 usr wm ... (8 Replies)