Calling a Perl script in a Bash script -Odd Situation
I am creating a startup script for an application. This application's startup script is in bash. It will also need to call a perl script (which I will not be able to modify) for the application environment prior to calling the application. The problem is that this perl script creates a new shell when started and will not automatically exit. Therefore it will sit until I enter “exit”, then the application will start, but I lost the environment I need.
Simple Application Script Example: Putting the “Perl_env_script” in the background still placed the needed environment outside the application and I don't get the environment I need when the application starts.
I also want to mention that I can manually type the command `Perl_env_script`, which leaves me in its current shell, where I can manually start the application normally. Unfortunately, this will be used from an application menu launcher and so I need to automate this process.
If this cannot be done, then I'll take the time to go through the perl script (which is huge and confusing) to gain the environment I need, but I was hoping there was an easier way.
Thanks for your help!
Frustrated Newbie
---------- Post updated at 03:23 PM ---------- Previous update was at 12:13 PM ----------
I got it working, but it's a two-step process:
I created a one-line script that calls the Perl script within an xterm: Once the xterm is up, the user will have to start another script to start the application:
I don't like the two-step process, but it is working. I might receive some complaints from users. So, if you know of a more streamlined way of doing this, please let me know.
Hi,
I have one shel script which returns some value and I am calling this shell script from a perl script which needs the out put/return value of shell script.
But I don't know how to collect the output/return value of the shell script. Can any one give some idea on it?
For example:
The... (1 Reply)
hi all,
I have 3 perl scripts a.pl,b.pl and c.pl
each of these work when i pass a date for eg: perl c.pl 2010-05-27
now i want to write a perl script that would call the 3 scripts and make it run all the 3 scripts (a.pl,b.pl,c.pl) parallelly rather than 1 after the other.......
pls... (2 Replies)
Hi,
I have tried several times but failed, I need to call this script from the perl script. This one line script will be sent to /var/tmp/error
Bash command:
/usr/openv/netbackup/bin/admincmd/bperror -backstat -l -hoursago 12 |awk '{ print $19, $12, $14, $16}'|grep -vi default|sort >... (12 Replies)
Hi,
I am trying to call a bash script from a java file.
Code to call bash script will look like:
Runtime runtime = Runtime.getRuntime();
Process process = runtime.exec("mybashfile.sh");
It is succesfully calling the bash file.
I am using simple rm commands in the script to remove... (0 Replies)
I am trying to run a perl script which needs input arguments from a parent perl script, but doesn't seem to work. Appreciate your help in this regard.
From parent.pl
$input1=123;
$input2=abc;
I tried calling it with
system("/usr/bin/perl child.pl $input1 $input2");
and
`perl... (1 Reply)
Can someone let me know how could I achieve this
In one of per script I am calling the shell script but I need to so one thing that is one shell script call I need to pass pne argument.In below code I am calling my ftp script but here I want to pass one argument so how could I do this (e.g:... (5 Replies)
Hi,
I am working on a sever A.
I want to write a perl script to execute a shell script persent on the server B.
please help me in this.
thanks in advance. (3 Replies)
hi,
i have 2 perl scrips, a.pl and b.pl.
i want to call b.pl from a.pl and once b.pl is executed, would like to return value from b.pl to a.pl.
######## a.pl ##############
$test = `./b.pl 1`;
print "file a: $test \n";
####### b.pl ##############
print "file b: $ARGV \n";
return 100;
... (3 Replies)
Hi,
I am having two individual scripts
Script 1): CGI script - is a simple script which trigger bash script
Script 2): Bash script - is a script which execute which collects file system utilization information from all the Unix servers
If I am executing CGI script manually from command... (2 Replies)