I have to run a shell script from a perl script and where every function is called i have to insert a echo statement.
help needed..........
Collapse
X
-
Originally posted by rohitkecI have to run a shell script from a perl script and where every function is called i have to insert a echo statement.
Well, what have you tried so far? Please keep in mind that if you are calling a shell script from a Perl script, then the script will be run and the code inside executed. This means that you will have to have your echo statements already inside of your shell script.
Please post the code you have tried and we can help you from there.
Regards,
Jeff -
sir,
actually I am new to perl script.i have made a shell script:
then i have made a perl program:Code:#!/bin/bash a() { echo "in func f" } b() { echo "in func b" } a b
[CODE=perl]
#!/usr/bin/perl
use warnings;
print `/home/rohit/perl/fun`;
[/CODE]
in this code I am able to run a shell script but i am not able to edit it.How can i place some more echo statements in shell script from perl program.Comment
-
First, I have deleted the post that you made before replying to this one as they were asking the same exact question. Please do not double post in the forums.
Ok, in your code above, to execute the Perl script, you certainly don't need the print statement, just what follows it, in back tics.
As for inserting echo statements into the perl script, you should have already had the needed echo statements in the shell script prior to execution. You cannot do it on the fly as the execution will happen outside of Perl's processing. You could possibly write some perl code to insert some echo statements into the script, prior to execution, but not during.
Regards,
JeffComment
-
Your question makes absolutely no sense. Even seeing your code below it is unclear what you are trying to do.Originally posted by rohitkecI have to run a shell script from a perl script and where every function is called i have to insert a echo statement.
Please spell out clearly what you want and what you have already attempted.
- MillerComment
Comment