![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
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 |
| Display Modes | Rate This Thread |
|
|