Unix Programming - How to get 2 outputs through a pipe

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > April 2006 > How to get 2 outputs through a pipe





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author How to get 2 outputs through a pipe
jeniffer

2006-04-27, 7:55 am

I need to get the file names also with function names in this system
command tht runs from a PERL script.How to do it?
system("nm `find . -name '*.o'`|grep -v '.o:'|cut -c 10-|grep ^T|cut -c
3-|grep -v '\\.'|sort|uniq > T.txt");

T.txt must have :
func name objfilename

Hubble

2006-04-27, 7:55 am

>I need to get the file names also with function names >in this system
>command tht runs from a PERL script.How to do it?


If you call the command from perl, why don't you analyze the output
from perl. You can use open("cmd ... |") to start a command and read
it's output

open(NM,"nm `find . -name '*.o'` |") || die "nm: $!, stopped":

while (<NM> ) {
chomp;
if (/(.*\.o) { $objname=$1; }
...
}

Hubble.

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com