how to invoke external program and capture its output
Hi all,
I am using an external binary to view memory starting from a specific address and i want to automate this via PERL however there are problems. Hope you can help me ..thx
I have around 30K of addresses which i want to send each to the programme above and split & save in a seperate log file ..i firstly tried to verify that programme executes and run properly for just 1 address in the list, however i can`t see all the output ( see just 1 line) when i run the perl script below:
============================================================
Code:
#!/usr/bin/perl -w
open (FILE, 'addr.txt');
foreach my $line (<FILE>){
$command = `mem_disp $line 80`;
print "$command";
}
close (FILE);
=============================================================
This gives the following output:
Code:
bash-3.2$ split.pl
sh: line 1: 80: command not found
Opening RO Data Memory File scp.ro
Opening Memory File CP2.16.0000000c.18.pmd.raw
12B21D20 12B6E500 *.... *
-------------------------------------------------------------------
---------- Post updated at 11:23 AM ---------- Previous update was at 11:09 AM ----------
I think perl just cant see 80 in the command ..because the output is same as saying mem_disp <addr> without the number at the end..
Moderator's Comments:
Code tags for code, please.
Last edited by Corona688; 08-03-2012 at 01:30 PM..
I'm working on a script that will perform a backup, save a log of said backup and send the output to me in an email. Everything is working fine so far except that I can't figure out how to specify a maximum file size for the log file. I don't want a runaway log file jamming up the server.... (7 Replies)
I have a simple script like this:
for file in $dodfiles; do
./rundod $file
done
$dodfiles is an array of file names selected
rundod is a script which invokes a java progrm which process a data file
all the processing message logged into a log file
in order to extract and analyze the... (1 Reply)
This code is in my 'case' statement and it all else works fine.
The problem I have is that the value in 'procno' is not passed on to the external program (fireit).
It is passing all zeros instead of the actual process number.
By the time I get to this case statement, I know the "Number" and... (1 Reply)
Hey all,
My boss tasked me with the job to write a script which would invoke various java programs, the thing is I don't know much about shell scripting so would you experts help me out?
Here is the requirement
- 2 applications written in java: App_A and App_B
-... (0 Replies)
How can i invoke java program from MC1, when I connect remotely to execute can I set classpath etc.
____________ <-------------->____________________
|..................|<-------------->|...............................|
|..................|<-------------->|...............................|... (2 Replies)
hi
i want to invoke a unix script in a C program and also return some value from the script to the C program to use that value further.
Basically i am doing a Lookup operation in this unix script and returning the looked up data from a oracle database table..
please help me invoke as well... (1 Reply)
Hi,
I have create a Shell Script, with one function.
I want to call the script file in Java Program.
It working fine. but the problem is the function in the Shell Script is not executed.
Please suggest me,
Regards,
Nanthagopal A (2 Replies)