Sponsored Content
Top Forums Shell Programming and Scripting how to find matching braces using sed or in shell script Post 302257601 by Boopesh on Wednesday 12th of November 2008 03:35:07 PM
Old 11-12-2008
dude, I got it. I added an extra flag to print that matching brace.
Thank u very much, u made it so simple.!!!Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to find file name for non matching pattern

Hi, I want to list only the file names which do not contain a specific keyword or search string. OS: Solaris Also is there any way ; through the same script I can save the output of search to a CSV (comma seperated) so that the file can be used for inventory purpose. Any assistance will... (5 Replies)
Discussion started by: sujoy101
5 Replies

2. 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

3. Shell Programming and Scripting

sed find matching pattern delete next line

trying to use sed in finding a matching pattern in a file then deleting the next line only .. pattern --> <ad-content> I tried this but it results are not what I wish sed '/<ad-content>/{N;d;}' akv.xml > akv5.xml ex, <Celebrant2First>Mickey</Celebrant2First> <ad-content> Minnie... (2 Replies)
Discussion started by: aveitas
2 Replies

4. Shell Programming and Scripting

Select block of text around matching braces

Hi, I have several block of text that I need to select, however this text may be spread over several lines and contains the '{' and '}' within it. For e.g., ABC=100{ DEF = 200 { GHI, JKL } } #2nd Block 123 { 456{78,910}} }I am trying to figure out how to remove... (2 Replies)
Discussion started by: BootComp
2 Replies

5. UNIX for Dummies Questions & Answers

Matching pattern script (sed or awk?)

Hi Guys, I am new to the forum and to scripting so bear with me. Thanks, Gary. I have 3 files - file1, file2, file3 I am trying to come up with a script that will check the output of these files and if the 1st nine fields are matched in all 3 files, echo "The following string had been... (2 Replies)
Discussion started by: gazza-o
2 Replies

6. Shell Programming and Scripting

find -regex not recognizing curly braces

Must be a bug or something. Whether I escape them or not, it will not work. No matter what I set the minimum and maximum to nothing gets caught. For instance: find / -regex "/.{0, 50}.*" -maxdepth 1 or find / -regex "/.\{0, 50\}.*" -maxdepth 1 should pretty much catch everything residing within... (4 Replies)
Discussion started by: stevensw
4 Replies

7. Shell Programming and Scripting

sed in windows does not parse curly braces

Hi everyone: I'm stuck at this point, could you guys please give me some hints about what I am doing wrong in the following script, I'm using sed for windows: sed ^"$ {^ a^ STRINGTABLE DISCARDABLE^ BEGIN^ #define CLIENT_MODULE, "%CLIENT_MODULE%"^ #define CLIENT_ID, "%CLIENT_ID%"^... (1 Reply)
Discussion started by: edgarvm
1 Replies

8. Shell Programming and Scripting

Help me to find files in a shell script with any matching pattern

Hi friends.. I have many dirs in my working directory. Every dir have thousands of files (.jsp, .java, .xml..., etc). So I am working with an script to find every file recursively within those directories and subdirectories ending with .jsp or .java which contains inside of it, the the pattern... (3 Replies)
Discussion started by: hnux
3 Replies

9. Shell Programming and Scripting

sed to remove braces from a file

i need to search for user belonging to group 'macusr' and the extract the user name . i am able to write a oneliner for this using awk + sed + tr i am using tr to chop off '()' from the output. but i want to use it in sed itself . can someone please help me with that file contents ... (7 Replies)
Discussion started by: chidori
7 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
PARTY(1)						      General Commands Manual							  PARTY(1)

NAME
party - set OS responses mode SYNOPSIS
party ON|OFF|WHEREIS [ - ] dnv DESCRIPTION
Operating systems being what they are, the admin people can easily grow tired of command responses that resemble dyslexic eugene- speak filtered through Kernighan and Ritchie's collective back-brains. To alleviate this, we have included a slightly more `casual' mode, in which the responses to all commands are first filtered through a customising routine (DUDE) , which makes them sound a little more friendly while retaining their full information content (usually). The rooted(c) system prompt is changed to `What now, dude?' and output from each command is terminated by `No problem, dude.' OPTIONS
-v Verbose mode (ALL commands have a `verbose' mode). When this option is present, all filtered responses are preceeded by a message: `This response has been parsed by the DUDE filter and is not intended to be some sort of sleazy come-on.' -d Don't restart all processes after recompiling the /uselss/libs/eugene file (see below). This alows any important tasks to complete beforehand. -n Notify all users that they are about to be force-logged out and force-logged in again. ON Activates the DUDE filter. OFF De-activates the DUDE filter. WHEREIS Doesn't do anything, but we couldn't resist it. EXAMPLES
%-) party on What now, dude? To compare the differing responses, here is output provided by the ispi -s command, with party OFF and party ON: party OFF line who why how long ========================================================== 000 rooted that's you, dweeb! epoch ---------------------------------------------------------- 00F wp she's supposed to be 0:44:12 typing up the end of financial year report, but she's been doing her resume when she thinks no-one is watching ---------------------------------------------------------- 014 maint playing games, as usual 0:51:16 party ON Well, let's see who's on, eh? There's you, of course, on line 000 (Imagine that! Hahaha!) Oh look, on serIOus line 00F, it's that cute little secretary - looks like she's lost her keyboard template again, she's been hitting the escape key for the past five minutes! AND OF COURSE, the guys down in maintenance are playing `cosmic ballcrushers'. As usual. Well, who else, um, no-one really interesting like, ya know, oh hang on, DTR is toggling on serIOus line 03D.. oh, no problem, it's that stuffed modem again. You want maybe I should send some AMail to maintenance and get 'em to look at it? No problem, dude. What now, dude? FILES
/uselss/libs/bill&ted/DUDE This is the pipe process, usually started at system shoe, which lies idle until party ON is issued. /uselss/libs/eugene Contains all of the ordinary, ho-hum confusing computer - jargonese responses which commands ordinarily issue. Text file. /uselss/libs/eugene.spoo compiled version of the eugene file. /ephemeral/eugene.chex Checksum for the compiled eugene file. SEE ALSO
crp(1), stuffio(2), doobrie(9), gouge(3), ftang(65534), wi(-1), edmond(29), jumpstart(2), vo_mit(992) BUGS
The -n option can be slow. If the n option is issued, some users in a wi editing session may not receive the `warning, restart imminent' message until after the restart. There is no way selectively to follow symbolic links. Sunburne Computer, Inc. 9 October 1991 Aug 18, 1997 PARTY(1)
All times are GMT -4. The time now is 02:39 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy