break(3tcl) Tcl Built-In Commands break(3tcl)__________________________________________________________________________________________________________________________________________________NAME
break - Abort looping command
SYNOPSIS
break
_________________________________________________________________DESCRIPTION
This command is typically invoked inside the body of a looping command such as for or foreach or while. It returns a TCL_BREAK code, which
causes a break exception to occur. The exception causes the current script to be aborted out to the innermost containing loop command,
which then aborts its execution and returns normally. Break exceptions are also handled in a few other situations, such as the catch com-
mand, Tk event bindings, and the outermost scripts of procedure bodies.
EXAMPLE
Print a line for each of the integers from 0 to 5:
for {set x 0} {$x<10} {incr x} {
if {$x > 5} {
break
}
puts "x is $x"
}
SEE ALSO catch(3tcl), continue(3tcl), for(3tcl), foreach(3tcl), return(3tcl), while(3tcl)KEYWORDS
abort, break, loop
Tclbreak(3tcl)
Check Out this Related Man Page
break(1T) Tcl Built-In Commands break(1T)__________________________________________________________________________________________________________________________________________________NAME
break - Abort looping command
SYNOPSIS
break
_________________________________________________________________DESCRIPTION
This command is typically invoked inside the body of a looping command such as for or foreach or while. It returns a TCL_BREAK code, which
causes a break exception to occur. The exception causes the current script to be aborted out to the innermost containing loop command,
which then aborts its execution and returns normally. Break exceptions are also handled in a few other situations, such as the catch com-
mand, Tk event bindings, and the outermost scripts of procedure bodies.
EXAMPLE
Print a line for each of the integers from 0 to 5:
for {set x 0} {$x<10} {incr x} {
if {$x > 5} {
break
}
puts "x is $x"
}
SEE ALSO catch(1T), continue(1T), for(1T), foreach(1T), return(1T), while(1T)KEYWORDS
abort, break, 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.
Tclbreak(1T)
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)
Attempting to break from a case/esac paragraph while inside of a function. When executing the code below, entering the letter 'a', will prove that the directory exists, but the break command works for the if/fi, but not for the case/esac. So, in my example below, if an A is entered, the function... (8 Replies)
I setup termios structure with IGNBRK is not set and BRKINT is set.
To allow the process to receive signals I call: fcntl(fd, F_SETOWN, getpid());
I have made a signal handler to catch all signals. I can catch SIGINT when pressing ctrl+c but when I send break signal over serial then it cannot... (13 Replies)
have a query on this break. I am using a program where I am using a while loop to execute it. It will get into a file take the first file and then ping it and if the ip is reachable then it will mail. Now what happens is that when i ping the ip it does nopt come out of the loop and it says "reply... (11 Replies)
I am having trouble figuring this code
I want to grep a text from a file and if it match certain text it break out of the loop or it should continue searching for the text
Here is what I have written but it isn't working
while true
f=`grep 'END OF STATUS REPORT' filename`
do
if ... (9 Replies)
How can i break a text file into parts that occur between a specific pattern?
I have text file having various xml many tags like which starts with the tag "<?xml version="1.0" encoding="utf-8"?>" . I have to break the whole file into several xmls by looking for the above pattern.
All the... (9 Replies)
On my Solaris box I have to reboot some devices like below.
However I think this can be done through a script. I've create a list that contains the devices IP addresses.
Here's the logic:
Reboot 4 devices and sleep for 5mins(300s.) While the devices are rebooting, I would like to confirm... (9 Replies)
Hi everybody,
I'm trying to use a foreach command with two lists. The file.txt looks like this:
var1: 100 200 300
var2: 3 6 9
I'm trying to use a foreach command to associate the two variables together. My script looks like this:
#! /bin/tcsh
set a=(`cat file.txt | grep 'var1' | cut -d... (8 Replies)
Hi all, I am trying to make a for loop invoking files with different extensions (*.ugrd and *.vgrd) and I cant just make it work. Cant figure out how to load the files so as to use them in subsequent commands like the ones in this pseudo code. the files are arranged such that in one date for... (8 Replies)
I have been trying this program for a long time. I am trying to read a file named "odon" line by line; read the first line, send it to do a command saved in a file "perm", once the first line has finished going through the content of the file perm, the result is saved with the number of the line.... (17 Replies)
Hello,
can somebody help me on this please.
I have a list of numbers and I want to print them in one line seprated by a comma except the last one using awk
34
12
56
76
88
output
34,12,56,76,88
Thanks Sara (15 Replies)
I was trying to implement a nested for do loop to run a perl script.
for i in 1 10 50
do
for j in 2 12 55
do
perl script.pl "$i" "$i" "$j"
done
done
when I implemented it within a shell script, i got the output, but every time j value will 55, or basically the last value of j in... (10 Replies)
Hello everyone,
I am doing a check of the disk space using df -h, I want to combine the result in break line; but the result after while/done is empty:
# df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 20G 14G 4.6G 75% /
/dev/root 20G 14G 4.6G 75% /... (15 Replies)
My script will do:
while true
do
if ]; then
### here im mailing content of file.txt
fi
if ]; then
exit 0
fi
sleep 30m
done
If i add exit 1 after ### mail, script is getting stopped.
Can you please suggest, how to implement above requirement. Mine is Linux machine. (11 Replies)
]I would like to make the second file label 'b' print down the first file label 'a', like shifting down the file creating new lines I want it to print all the way down until the first line of the second file hit the last line of the first file. Would I have to put this into a file itself or could I... (24 Replies)