Sponsored Content
Full Discussion: Need help urgently
Top Forums Shell Programming and Scripting Need help urgently Post 302134761 by user_prady on Monday 3rd of September 2007 10:28:03 AM
Old 09-03-2007
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 .Smilie

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

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

link and unlink , urgently...

Hi all I did something incorrectly about link command. I try to make a link from a sub-dir to root dir, but I use the following command: link / zzz the result is sub-dir "zzz" was linked to "/" Then I want to remove the "zzz" by using unlink command: unlink zzz It say that "Device... (1 Reply)
Discussion started by: umonk
1 Replies

2. UNIX for Dummies Questions & Answers

Need Information Urgently.

Hi i dont know about the UNIX OS at all but now as my Project requires, i need to learn it as soon as possible. Could anybody please help me out in suggessting any good elementary book on UNIX OS so that atleast i can learn the commands for UNIX servers and at the same time within the short span... (3 Replies)
Discussion started by: sumit_krishan
3 Replies

3. Shell Programming and Scripting

help needed urgently

hi all i need help I am confused and stucked. Actually i am new in this scripting stuff. I want to give complete txt file as a input to a variable and then sort the data in the file according to the alpha numeric characters, as my text file contains ! and !! and !!! indicating Minor, Major and... (11 Replies)
Discussion started by: nabmufti
11 Replies

4. UNIX for Dummies Questions & Answers

CC Solution Required Urgently

Hi there, My question is: If the command cc is executed on obelix, what executable file will be run? Using the results of whereis, which and any other commands you consider necessary, explain why this file is executed. Please help as soon as possible thanks (5 Replies)
Discussion started by: satty
5 Replies

5. Solaris

most urgently about pc-routing

Hi I have knowledge is a little about Solaris 10. I have problem route Question I have two lan interfaces nge0 >> 192.168.1.1 / 24 and link up Client1 >> 192.168.1.10 not out internet (GW 192.168.1.254) nge1 >> 192.168.50.220 /24 and link up Client50 >> 192.168.50.1 can... (2 Replies)
Discussion started by: sermsuk
2 Replies

6. UNIX for Advanced & Expert Users

Help needed Urgently... Thanks in advance

You have a file called /opt/test/input.txt with the following information: man_aa_bld_100.410.040_CMD 08/14/2008 23:29:21 08/14/2008 23:31:10 SU 5339491/1 man_aa_bld_100.410.050_CMD 08/14/2008 23:29:21 08/14/2008 23:31:11 SU 5339491/1 man_aa_bld_100.410.060_CMD 08/14/2008 ... (3 Replies)
Discussion started by: jkumsi
3 Replies

7. Shell Programming and Scripting

Help need urgently....

I am new to shell scripting I am getting file sample.txt from mainframes to my unix machine Mon-Fri every 15 minutes from 9:00AM to 6:00PM. I need to Compare timestamp of sample.txt against system time via a Unix script kicked off by an Autosys job My Task is to write a shell script to monitor... (3 Replies)
Discussion started by: chinniforu2003
3 Replies

8. Shell Programming and Scripting

Script command - need help urgently

I have added script command to the .profile of the id, whose session needs to be captured. When exit command is issued, the script command exits. Is there a way to exit the parent shell also - and log off the system completely with one exit command? (8 Replies)
Discussion started by: ggayathri
8 Replies

9. Shell Programming and Scripting

Case Stmt - Need Help Urgently

Hello All, Need help urgently.. i have a scenario where i have two files 1) mireport_20111406.txt 2) PRLIHSP01_8080.2011-06-11-15_26_31 ---------- I want a query something similar to this algorithm :- Case when file_name is like mireport then extract_date=14-06-2011 when... (4 Replies)
Discussion started by: iamnoone
4 Replies

10. UNIX for Dummies Questions & Answers

Need answers urgently!!

hello guys!! need 1 favour from u all.. Can u jst tell me the answers for these ques?? 1. ls - l _____ : command to return all files that end with single digit and those with TXT extension 2. ls -l report* _______ : command to return all files that start with the word RPT except those with LOG... (1 Reply)
Discussion started by: Gan_7
1 Replies
Tree::Simple::Visitor::GetAllDescendents(3pm)		User Contributed Perl Documentation	     Tree::Simple::Visitor::GetAllDescendents(3pm)

NAME
Tree::Simple::Visitor::GetAllDescendents - A Visitor for fetching all the descendents of a Tree::Simple object SYNOPSIS
use Tree::Simple::Visitor::GetAllDescendents; # create an instance of our visitor my $visitor = Tree::Simple::Visitor::GetAllDescendents->new(); # pass the visitor to a Tree::Simple object $tree->accept($visitor); # you can also get the descendents # back as an array of node values my @descendents = $visitor->getDescendents(); # for more complex node objects, you can specify # a node filter which will be used to extract the # information desired from each node $visitor->setNodeFilter(sub { my ($t) = @_; return $t->getNodeValue()->description(); }); DESCRIPTION
Given a Tree::Simple instance this Visitor will return all the descendents recursively on down the hierarchy. METHODS
new There are no arguments to the constructor the object will be in its default state. You can use the "setNodeFilter" method to customize its behavior. setTraversalMethod ($visitor) By default we will use Tree::Simple's built in depth-first (pre-order) traverse method. If however, you desire the descendents to be returned in a different ordering, this can be accomplished using a different traversal method, you can supply a $visitor object implementing that traversal type to this method (See Tree::Simple::Visitor::BreadthFirstTraversal, Tree::Simple::Visitor::PreOrderTraversal and Tree::Simple::Visitor::PostOrderTraversal). setNodeFilter ($filter_function) This method accepts a CODE reference as its $filter_function argument and throws an exception if it is not a code reference. This code reference is used to filter the tree nodes as they are collected. This can be used to customize output, or to gather specific information from a more complex tree node. The filter function should accept a single argument, which is the current Tree::Simple object. visit ($tree) This is the method that is used by Tree::Simple's "accept" method. It can also be used on its own, it requires the $tree argument to be a Tree::Simple object (or derived from a Tree::Simple object), and will throw and exception otherwise. getAllDescendents This method will give back and array of descendents in depth-first order (pre-order) or in the order specified by the "setTraversalMethod". If called in scalar context it will give an array reference, in list context it will return a regular array. This method is the same as calling "getResults". BUGS
None that I am aware of. Of course, if you find a bug, let me know, and I will be sure to fix it. CODE COVERAGE
See the CODE COVERAGE section in Tree::Simple::VisitorFactory for more inforamtion. SEE ALSO
These Visitor classes are all subclasses of Tree::Simple::Visitor, which can be found in the Tree::Simple module, you should refer to that module for more information. AUTHOR
stevan little, <stevan@iinteractive.com> COPYRIGHT AND LICENSE
Copyright 2004, 2005 by Infinity Interactive, Inc. <http://www.iinteractive.com> This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.10.1 2005-07-14 Tree::Simple::Visitor::GetAllDescendents(3pm)
All times are GMT -4. The time now is 05:17 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy