Sponsored Content
Top Forums Shell Programming and Scripting Finding opening and closing braces Post 302295400 by sai21 on Sunday 8th of March 2009 04:02:24 AM
Old 03-08-2009
You can do the following way...
1. Intially you can set the counter varaible to 0
2. Whenevr you find a open brace increment the counter and store line number in a variable
3. When you find Close braces decrement the counter and then check the value of counter.
4. If the counter is zero, the print the strings in between starting line number and the closed braces (i.e count =0) and store it in a file.
5. Then search pattern in the stored file.
 

10 More Discussions You Might Find Interesting

1. Post Here to Contact Site Administrators and Moderators

Requests for Opening/Closing Threads

Please send an email to the administrator(s) of the board with thead ID and forum for any thread that is closed that you want open (or open that you want closed). All requested considered. Our apologies if sometimes threads are closed early. If this happens, please email :) Nobody is perfect... (0 Replies)
Discussion started by: Neo
0 Replies

2. Post Here to Contact Site Administrators and Moderators

Opening and closing threads

Hi all, Just thought I'd mention something I've noticed since joining this forum :) Would it be a good idea to close threads once the initial question that was posted has been answered? I notice a few posts where people go on and on and as soon as you post a reply to one question they... (2 Replies)
Discussion started by: _Spare_Ribs_
2 Replies

3. Shell Programming and Scripting

Finding the line number of matching braces

Hi,I am new to shell scripting and i want to find the line numbers of matching braces. The file contents are as follows File XXX.dat 1 ( CLASS "FRUIT" 2 (TYPE "PERSISTENT") 3 (MESSAGE_TYPE "M") 4 (GET_REQRD "Y") 5 (SET_REQRD "Y") 6 ) 7 ( CLASS... (3 Replies)
Discussion started by: Rajendra_1510
3 Replies

4. Shell Programming and Scripting

grep matter between braces

#include<header.h> void classname :: pvvd_init ( abcd ,efgh ,ijkl ,mnop ) { rvcl_tabl_name_tabl.pvvd_init ( xxxx ,"tabl_mame" ) ; ... (2 Replies)
Discussion started by: ultimatix
2 Replies

5. OS X (Apple)

Opening and Closing Shares via ssh

Might anyone have an idea on how to mount an xserve share via ssh, then close the share connection? (3 Replies)
Discussion started by: unimachead
3 Replies

6. Shell Programming and Scripting

Finding max number in filename and opening it

Hi, I have files named as energy.dat.1 energy.dat.2 energy.dat.3 ... energy.dat.2342 I would like to find the file with maximum number in the filename (ex. energy.dat.2342) and open it. Would you please share your expertize in writing the script? Thanks in advance. (8 Replies)
Discussion started by: rpd25
8 Replies

7. Shell Programming and Scripting

TCL - Question regarding Braces {}

Hello everyone, What is the difference between these two tcl commands: (A) --> puts "ERROR!!! ${current_name}/${opt} is not found." (B) --> puts "ERROR!!! $current_name/$opt is not found." Are the braces needed to be put? Or both A and B has the same output? (5 Replies)
Discussion started by: mar85
5 Replies

8. Shell Programming and Scripting

Help with Shell Script opening and closing a program

REALLY new to this stuff, sorry. So I want a shell script to open a program, wait 45 minutes, close it, and then do it all again. I want to do this because I am running an iMacros Script for a long period of time and if Firefox is not constantly restarted, memory leaks start to happen. Anyway... (6 Replies)
Discussion started by: plsbbg
6 Replies

9. Shell Programming and Scripting

For getting value between the braces

Hi I have a file called tmp with the content as belowmore tmp NAMELIST(Hari) NAMELIST(Raju) I want to get the values between the brackets. When I executed the below command on zlinux I get the output which I wantedmore tmp |awk -F'' '{print $2}' But when I execute the same in... (3 Replies)
Discussion started by: harimhkr
3 Replies

10. Shell Programming and Scripting

Curly braces in sed

Hi, I have below command in one of the script. Can you please let me know what does the curly braces do over here \{1,\}. The remaining part of the code atleast I am able to understand. sed -n 's/.*\-\()\{1,\}\)\-.*/\1/p' (13 Replies)
Discussion started by: tostay2003
13 Replies
rlm_counter(5)							 FreeRADIUS Module						    rlm_counter(5)

NAME
rlm_counter - FreeRADIUS Module DESCRIPTION
The rlm_counter module provides a general framework to allow access based on accumulated usage of a resource, such as total time online in a given period, total data transferred in a given period, etc. This is very useful in a 'Prepaid Service' situation, where a user has paid for a finite amount of usage and should not be allowed to use more than that service. Collection, monitoring, and replenishment of prepaid services are beyond the scope of this module. The main configuration items to be aware of are: filename The filename where the usage data is stored. key An attribute which will be present in the Access-Request to be used as the 'index' value for the counter. A counter entry is tracked for each unique key. The most likely key you will want to use is User-Name. count-attribute An attribute which will be used to increment the counter value. If this attribute is Acct-Session-Time or an integer value the counter data is incremented by the Attribute value. For all other attribute types the counter is incremented by one. reset How frequently the counter data should be set back to 0. Valid values for this variable are: hourly, daily, weekly, monthly, orn- ever Alternatively, it can be user defined, in the form: num[hdwm]. num is a numeric value, followed by one or none of the follow- ing letters. h: hours, d: days, w: weeks, m: months. check-name This defines an attribute name which will be registered by the counter module and can be used to set the maximum allowed value for the counter after which the user is rejected. If Daily-Session-Time is set, you can use the following syntax in the Users file to set a cap of 3600 seconds ( 8 hours ): DEFAULT Max-Daily-Session := 3600 reply-name This is the name of the attribute which will contain the remaining value for the counter in the reply packet when the user is suc- cessfully authorized. The default attribute name is "Session-Timeout". allowed-servicetype This can be used to only apply the limitations to specific service types of sessions. For example, setting this to Framed-User will only apply the counter module to Framed sessions, excluding other types such as Telnet or Rlogin. cache-size The maximum size of the cache to be used by the module. The default is 1000. NOTES
This module registers an attribute, so it should be added to the instantiate section, to be called on server startup. When used in the authorize section, it must come after any modules which set the 'check-name' attribute. SECTIONS
instantiate, authorize, accounting FILES
/etc/raddb/radiusd.conf SEE ALSO
radiusd(8), radiusd.conf(5) rlm_sqlcounter(5) AUTHOR
Chris Parker, cparker@segv.org 13 March 2004 rlm_counter(5)
All times are GMT -4. The time now is 10:34 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy