Sponsored Content
Top Forums Shell Programming and Scripting Null Handling in Until loop. . .loop won't stop Post 302374483 by Scrutinizer on Tuesday 24th of November 2009 03:33:42 PM
Old 11-24-2009
Try
Code:
((limit == var))

As it was written above it means: assign the value of var to limit. The value of limit determines the outcome, if more than 0 then the outcome is true.

Last edited by Scrutinizer; 11-24-2009 at 05:05 PM..
 

10 More Discussions You Might Find Interesting

1. Programming

how to stop execution in for loop

Hi all, I am working on a c source code nearly 2000 line . it contains one big for( i=0; i< 200 ; i++ ) loop of around 600 lines could any tell me how to break the execution of prog when the value of i is 50 in for loop so that i can check inside the loop. Thanks.. (1 Reply)
Discussion started by: useless79
1 Replies

2. UNIX for Dummies Questions & Answers

Anyone know?: How the 'for'-loop could stop working in interactive bash shell?!

It is happening with my sessions already second time: a 'for'-loop for some reason stop to work as expected. That means or it is looping without exitting, or it is not loop even once. Here example of my try when it is not processing even one loop. You can see, I start new subshell and... (14 Replies)
Discussion started by: alex_5161
14 Replies

3. Shell Programming and Scripting

String handling is not working inside if loop

Hi All, I am comparing two strings inside an if condition if the strings are same then it should go inside the loop else it should execute code given in else part. But there is a but inside my script Even if the if condition is true it is not going inside the loop also it is executing... (4 Replies)
Discussion started by: usha rao
4 Replies

4. Shell Programming and Scripting

Using variables created sequentially in a loop while still inside of the loop [bash]

I'm trying to understand if it's possible to create a set of variables that are numbered based on another variable (using eval) in a loop, and then call on it before the loop ends. As an example I've written a script called question (The fist command is to show what is the contents of the... (2 Replies)
Discussion started by: DeCoTwc
2 Replies

5. Shell Programming and Scripting

Basic While loop won't exit...

Hi everyone - just like to say great forum...I've learned a lot off here but I just can't figure this one out...(first post) I'm writing a script to monitor a directory and email the latest modified file....(I realize there are better ways than I'm trying here...I don't like copying and pasting... (5 Replies)
Discussion started by: trevthefatty
5 Replies

6. Shell Programming and Scripting

howto stop loop iteration

I wonder how to stop further loop iterations when conditions gets false e.g. This file.txt contains the following structure : 1 2 3 4 5 6 7 8 9 10 How to stop iteration when if statement gets false ? for n in `cat file.txt` do if (( n<=5 )) (1 Reply)
Discussion started by: presul
1 Replies

7. Shell Programming and Scripting

Loop to read parameters and stop

Hey guys, How do I make a loop that reads all the parameters en then stop when there are no parameters anymore ? Something that gives an output like this: ./Script.sh parameter1 parameter2 parameter3 parameter = parameter1 parameter = parameter2 parameter = parameter3 Thanks a lot,... (5 Replies)
Discussion started by: Miki1579
5 Replies

8. Shell Programming and Scripting

problem handling lov in FOR loop

Hi all, i am trying to process a list of values in FILE like this: aaa:bbb ccc:ddd eee:fff With the following logic: for INFO in FILE do export F1=`cut -f1,3,5,7 -d":" < FILE` export F2=`cut -f2,3,5,7 -d":" < FILE` ssh $F1 bash <<EOF echo $F1 echo $F2 date (10 Replies)
Discussion started by: jonnyd
10 Replies

9. Shell Programming and Scripting

How to stop infinite loop

Im unable to stop the below infinite loop (bash script). Can someone tell me why this isnt responding to signals eg: ctrl+c (SIGINT) or ctrl+z c=0 test_loop() { c=$(($c+1)) echo "count value is : $c " sleep 1 test_loop } Im using: SunOS 5.10 PS: If run this as... (13 Replies)
Discussion started by: Arun_Linux
13 Replies

10. Shell Programming and Scripting

awk loop using array:wish to store array values from loop for use outside loop

Here's my code: awk -F '' 'NR==FNR { if (/time/ && $5>10) A=$2" "$3":"$4":"($5-01) else if (/time/ && $5<01) A=$2" "$3":"$4-01":"(59-$5) else if (/time/ && $5<=10) A=$2" "$3":"$4":0"($5-01) else if (/close/) { B=0 n1=n2; ... (2 Replies)
Discussion started by: klane
2 Replies
tokenmt(7ipp)						   IP Quality of Service Modules					     tokenmt(7ipp)

NAME
tokenmt - Single and Two Rate Three Conformance Level Meter DESCRIPTION
The tokenmt module can be configured as a Single or a Two Rate meter. Packets are deemed to belong to one of the three levels - Red, Yellow or Green - depending on the configured rate(s) and the burst sizes. When configured as a Single Rate meter, tokenmt can operate with just the Green and Red levels. Configuration parameters for tokenmt correspond to definitions in RFC- 2697 and RFC- 2698 as follows: Configuring tokenmt as a Single Rate meter (from RFC- 2697): committed_rate - CIR committed_burst - CBS peak_burst - EBS (thus 'peak_burst' for a single rate meter is actually the 'excess burst' in the RFC. However, throughout the text the parameter name "peak burst" is used.) Configuring tokenmt as a Two Rate meter (from RFC- 2698): committed_rate - CIR peak_rate - PIR committed_burst - CBS peak_burst - PBS The meter is implemented using token buckets C and P, which initially hold tokens equivalent to committed and peak burst sizes (bits) respectively. When a packet of size B bits arrive at time t, the following occurs: When operating as a Single Rate meter, the outcome (level) is decided as follows: - Update tokens in C and P o Compute no. of tokens accumulated since the last time packet was seen at the committed rate as T(t) = committed rate * (t - t') (where t' is the time the last packet was seen) o Add T tokens to C up to a maximum of committed burst size. Add remaining tokens ((C+T) - Commited Burst), if any, to P, to a maximum of peak burst size. - Decide outcome o If not color aware o If B <= C, outcome is GREEN and C -= B. o Else, if B <= P, outcome is YELLOW and P -= B. o Else, outcome is Red. o Else, o obtain DSCP from packet o obtain color from color_map, color_map[DSCP] o if (color is GREEN) and (B <= C), outcome is GREEN and C -= B. o Else, if (color is GREEN or YELLOW) and (B <= P), outcome is YELLOW and P -= B. o Else, outcome is RED. Note that if peak_burst and yellow_next_actions are not specified (that is, a single rate meter with two outcomes), the outcome is never YELLOW. When operating as a Two Rate meter, the outcome (level) is decided as follows: - Update tokens in C and P o Compute no. of tokens accumulated since the last time a packet was seen at the committed and peak rates as Tc(t) = committed rate * (t - t') Tp(t) = peak rate * (t - t') (where t' is the time the last packet was seen) o Add Tc to C up to a maximum of committed burst size o Add Tp to P up to a maximum of peak burst size - Decide outcome o If not color aware o If B > P, outcome is RED. o Else, if B > C, outcome is YELLOW and P -= B o Else, outcome is GREEN and C -= B & P -= B o Else, o obtain DSCP from packet o obtain color from color_map, color_map[DSCP] o if (color is RED) or (B > P), outcome is RED o Else, if (color is YELLOW) or (B > C), outcome is YELLOW and P -= B o Else, outcome is GREEN and C -= B & P -= B STATISTICS
The tokenmt module exports the following statistics through kstat: Global statistics: module: tokenmt instance: <action id> name: tokenmt statistics class <action name> epackets <number of packets in error> green_bits <number of bits in green> green_packets <number of packets in green> red_bits <number of bits in red> red_packets <number of packets in red> yellow_bits <number of bits in yellow> yellow packets <number of packets in yellow> FILES
/kernel/ipp/sparcv9/tokenmt 64-bit module (SPARC only.) ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWqos | +-----------------------------+-----------------------------+ SEE ALSO
ipqosconf(1M), dlcosmk(7IPP), dscpmk(7IPP), flowacct(7IPP), ipqos(7IPP), ipgpc(7IPP), tswtclmt(7IPP) RFC 2697, A Single Rate Three Color Marker J. Heinanen, R. Guerin -- The Internet Society, 1999 RFC 2698, A Two Rate Three Color Marker J. Heinanen, R. Guerin -- The Internet Society, 1999 SunOS 5.10 29 Sep 2004 tokenmt(7ipp)
All times are GMT -4. The time now is 08:24 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy