Sponsored Content
Full Discussion: grep matter between braces
Top Forums Shell Programming and Scripting grep matter between braces Post 302297646 by ultimatix on Saturday 14th of March 2009 07:33:27 AM
Old 03-14-2009
Bug grep matter between braces

Code:
#include<header.h>
void classname :: pvvd_init        
                   ( abcd
                    ,efgh
                    ,ijkl
                    ,mnop )
{                       
  rvcl_tabl_name_tabl.pvvd_init
                   ( xxxx
                    ,"tabl_mame" ) ;
  rvvd_call_tabl ()
}
 
void classname :: rvvd_call_tabl       <<<<  ----  2nd function 
                   ( abcd
                    ,efgh
                    ,ijkl
                    ,mnop )
{
  rvcl_tabl_name_tabl.pvvd_init
                   ( xxxx
                    ,"tabl_mame" ) ;
rvvd_inst_for_tabl ()
}
void classname :: rvvd_inst_for_tabl    <<<<---- 3rd function
                   ( abcd
                    ,efgh
                    ,ijkl
                    ,mnop )
{
  rvcl_tabl_name_tabl.pvvd_init
                   ( xxxx
                    ,"tabl_mame" ) ;
 rvcl_tabl_name_tabl.pvvd_inst
}

In the above cpp class
pvvd_inst is called by function rvvd_inst_for_tabl which is in turn called by function
rvvd_call_tabl..
I am developing a script which reads a cpp class .. Finds the pvvd_inst function
and backtraces it ...
eg : pvvd_inst <<<<<------ rvvd_inst_for_tab <<<<<------rvvd_call_tabl ..
I have tried it in following way :

I am reading cpp files from a file and grepping for a paatern
Code:
grep -w 'pvvd_inst' $rvst_clas_name >> tempfile1
        
    if  [ `ll inst_fncn.tmp | awk {'print$5'}` -eq 0 ] ;
        then
  Now I am checking the filesize , If its equal to zero thn i am concluding 
  inst fncn not callled in this class
  echo ""
  echo "pvvd_inst not called in this class "$rvst_clas_name""

   The problem starts with else part .... How do i proceedc  
        
 else
 In the else part , The logic that i developed is to  read the file line by line
 Capture text between opening and closing braces of each function .. and then grep 
 but I am running short of how to implement these ideas ...
   fi

Please Help .....
thanks and Regards
--- Ultimatix

Last edited by Franklin52; 03-14-2009 at 04:06 PM.. Reason: adding code tags
 

7 More Discussions You Might Find Interesting

1. Linux

Need help with this matter

I have a PC that was built in Europe pre-installed with Windows 2000. The HDD is 40GB, but, its split up as two 20GB (Taken up by Windows). I want to take over my Mandrake 9.1 CDs and install Linux on that machine. My question is, how would I proceed to install Linux this way??? Now, If... (1 Reply)
Discussion started by: wardialer
1 Replies

2. Shell Programming and Scripting

grep to find content in between curly braces, "{" and "},"

problem String ~~~~~~~~~~~~~~~~~~ icecream= { smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" } aend = {smart vc4 eatr kalu} output needed ~~~~~~~~~~~~~~~~~~ smart peopleLink "good" LC "happy" , smartpeopleLink "dull" LC "sad" smart vc4... (4 Replies)
Discussion started by: keshav_rk
4 Replies

3. Shell Programming and Scripting

How to delete matter in between two lines

help I am having text file like this... ------------------------END OF UPDATION ------------------ xxxxxxxxxxxxxxxxxxxxxxxxx yyyyyyyyyyyyyyyyyyyyy yyyyyyyyyyyyyyyyyyyyy 1 row updated ------------------------END OF UPDATION ------------------ TTTTTTTTTTTTTTTT FFFFFFFFFFFFFFFFF ... (3 Replies)
Discussion started by: suryanarayana
3 Replies

4. Shell Programming and Scripting

Terminal to the front no matter what

Is there a way to bring the terminal script to the front? I am running this script through OMCEdit which is then running it through Terminal. I have some dialog boxes (using osascript) and the dialog boxes are not coming to the front...Terminal bounces and I have to click on Terminal to see the... (1 Reply)
Discussion started by: mainegate
1 Replies

5. Solaris

Does file extension matter in UNIX?

Hi friends, I was wondering if UNIX programs really care about file extensions like Microsoft Windows applications do. Because I think an extension doesn't really change the nature of a file, or does it? But when I try to compile the c source code file named "hello", gcc gives me error, saying... (1 Reply)
Discussion started by: gabam
1 Replies

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

7. Shell Programming and Scripting

Code that has to end no matter what

Since this is maxxing out my CPU, is there anything I can add that will make sure stress always ends? echo "CPU Stress Test" >> CPU_Stress_Test.txt echo "stress --cpu 8 --io 4 --vm 2 --vm-bytes 128M --timeout 1m" >> CPU_Stress_Test.txt echo >> CPU_Stress_Test.txt date +"%Y-%m-%d-%H-%M" >>... (9 Replies)
Discussion started by: drew77
9 Replies
ppmtosixel(1)						      General Commands Manual						     ppmtosixel(1)

NAME
ppmtosixel - convert a portable pixmap into DEC sixel format SYNOPSIS
ppmtosixel [-raw] [-margin] [ppmfile] DESCRIPTION
Reads a portable pixmap as input. Produces sixel commands (SIX) as output. The output is formatted for color printing, e.g. for a DEC LJ250 color inkjet printer. If RGB values from the PPM file do not have maxval=100, the RGB values are rescaled. A printer control header and a color assignment table begin the SIX file. Image data is written in a compressed format by default. A printer control footer ends the image file. OPTIONS
-raw If specified, each pixel will be explicitly described in the image file. If -raw is not specified, output will default to com- pressed format in which identical adjacent pixels are replaced by "repeat pixel" commands. A raw file is often an order of magni- tude larger than a compressed file and prints much slower. -margin If -margin is not specified, the image will be start at the left margin (of the window, paper, or whatever). If -margin is speci- fied, a 1.5 inch left margin will offset the image. PRINTING
Generally, sixel files must reach the printer unfiltered. Use the lpr -x option or cat filename > /dev/tty0?. BUGS
Upon rescaling, truncation of the least significant bits of RGB values may result in poor color conversion. If the original PPM maxval was greater than 100, rescaling also reduces the image depth. While the actual RGB values from the ppm file are more or less retained, the color palette of the LJ250 may not match the colors on your screen. This seems to be a printer limitation. SEE ALSO
ppm(5) AUTHOR
Copyright (C) 1991 by Rick Vinci. 26 April 1991 ppmtosixel(1)
All times are GMT -4. The time now is 01:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy