The UNIX and Linux Forums  


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
CC Solution Required Urgently satty UNIX for Dummies Questions & Answers 5 05-29-2008 08:04 AM
help needed urgently nabmufti Shell Programming and Scripting 11 02-11-2008 08:17 AM
Setting Up Profile.......Need Help Urgently reachtokhan UNIX for Advanced & Expert Users 13 11-06-2007 03:06 PM
Need Information Urgently. sumit_krishan UNIX for Dummies Questions & Answers 3 06-08-2005 07:13 AM
link and unlink , urgently... umonk UNIX for Advanced & Expert Users 1 12-17-2001 12:06 PM

 
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 09-03-2007
user_prady user_prady is offline
Registered User
  
 

Join Date: Sep 2007
Posts: 163
Need help urgently

Hi to All,

I m a regular visitor of this site but this one is my first thread .
Although I ve tried but I cant find the solution .

I ve number of files having extension .file., which having some define statement in it.The files consits as follows
Ex:-
abc.file
`define ADCONV0 TB_DIGRFAFE.digrf0.udigrf_top.uad0_wrap
`define APLL TB_DIGRFAFE.digrf0.udigrf_top.uapl_wrap
`define DPLL TB_DIGRFAFE.digrf0.udigrf_top.udpl_wrap

bcd.file

`define APLL TB_DIGRFAFE.digrf0.udigrf_top.uapl_wrap
`define DPLL TB_DIGRFAFE.digrf0.udigrf_top.udpl_wrap
`define DACONV0 TB_DIGRFAFE.digrf0.udigrf_top.uda0_wrap
`define TOP TB_DIGRFAFE.digrf0
`define SCI TB_DIGRFAFE.digrf0.udigrf_top.usci_wrap

output should be
Path of FILE ./abc.file
same
same
same

Path of FILE ./bcd.file
same
same
same
`define TOP TB_DIGRFAFE.digrf0
`define SCI TB_DIGRFAFE.digrf0.udigrf_top.usci_wrap

The last two lines output because they are not defined inside my
shell script...
My program is like below

#!/bin/sh
for temp in `find . -name '*.file'`# Temp stores all the .file extension
do
echo "Path of FILE $temp"

nawk '\
BEGIN{

#lookup table defination

ref_arr["ADCONV0"] = "TB_DIGRFAFE.digrf0.udigrf_top.uad0_wrap"
ref_arr["APLL"] = "TB_DIGRFAFE.digrf0.udigrf_top.uapl_wrap"
ref_arr["DPLL"] = "TB_DIGRFAFE.digrf0.udigrf_top.udpl_wrap"
ref_arr["DACONV0"] = "TB_DIGRFAFE.digrf0.udigrf_top.uda0_wrap"
}

/^`define/ {
str = $2
val = $3
for(item in ref_arr){
if( str == item){
if (ref_arr[str] == val)
print "same"
else
print $0
}
}
} ' $temp
done

Now I m getting output as follows
Path of FILE ./x.file
same
same
same
Path of FILE ./y.file
same
same
same
Path of FILE ./abc.file
same
`define DACONV0 cat.grep.cut


I know there are some logical mistakes in my for loop but I m not able to catch it.
-------------------------------------------------------------------------



Please pls pls help.........
Prady

Last edited by user_prady; 09-03-2007 at 10:36 PM..
 

Bookmarks

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 07:54 AM.


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