The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Pattern matching extracting urls from rss, shell scripts BremboloIV Shell Programming and Scripting 3 04-30-2009 02:54 PM
problem using sed for pattern matching lassimanji Shell Programming and Scripting 5 04-22-2009 04:42 PM
pattern matching problem namishtiwari Shell Programming and Scripting 2 05-23-2008 07:33 AM
pattern matching problem rein Shell Programming and Scripting 8 10-26-2007 11:44 PM
vi part-pattern matching and deletion vino UNIX for Dummies Questions & Answers 5 04-04-2005 01:53 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 07-15-2009
paxilpaz paxilpaz is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 1
Problem extracting just a part of a matching pattern

Hello everyone, this is my first post so please give me a hand.
I apologize for my English, I'll try to be clear with my request.
I need to write a script (Bash) which finds all the variables defined in the file .h of the folder and then writes the name of the files .c where these variables are used.

I'd like to have a result like this:

MAXCAR
defined in xxx.h
used in yyy.c


The structure of the .h files is something like this:
#ifndef
#define XXX_H
.
.
#define MAXCAR 4
.
.
#endif

Of course the .c that uses the variable is something like this
#include "xxx.h"
.
.
.
int z=MAXCAR*4;

I hope I am clear with my request. I'll thank everyone who can help!
 

Bookmarks

Tags
bash, grep, pattern, regex, sed

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 01:47 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0