Sponsored Content
Top Forums Shell Programming and Scripting How to Run a shell script from Perl script in Parent shell? Post 302131778 by hifake on Monday 13th of August 2007 04:48:38 PM
Old 08-13-2007
Error How to Run a shell script from Perl script in Parent shell?

Hi Perl/UNIX experts,

I have a problem in running a shell script from my perl script (auto.pl).

I run the perl script using
perl auto.pl
from the shell prompt

The shell script picks the files in "input" folder and procesess it.

The shell script blue.sh has this code.

Code:
export JAVA_HOME=/opt/j2sdk1.4.2_02
export PATH=${JAVA_HOME}/bin:${PATH}
export MANPATH=${JAVA_HOME}/man:${MANPATH}
export RUNPATH=:.:/export/home/lib/activation.jar:/export/home/lib/commons-dbcp-1.1.jar:/export/home/lib/jdbc2_0-stdext.jar:/export/home/lib/libmqjbnd05.so:/export/home/lib/postcard.jar
export RUNPATH=$RUNPATH:/export/home/lib/ant.jar:/export/home/lib/commons-logging-api.jar:/export/home/lib/jms.jar:/export/home/lib/log4j-1.2.8.jar:/export/home/lib/providerutil.jar
export 
java -classpath $RUNPATH placeOrders ./input/

I tried to run this in perl script using
exec("blue.sh")
exec("./blue.sh")
`./blue.sh`
`sh blue.sh`


I get this error - ./blue: JAVA_HOME=/opt/j2sdk1.4.2_02: is not an identifier

But if i run it manually from the shell
Code:
./blue.sh

the script runs fine.

I guess the problem is because perl spawns a new shell.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

returning to the parent shell after invoking a script within a script

Hi everybody, I have a script in which I'm invoking another script which runs in a subshell. after the script is executed I want to return to the parent shell as some variables are set. However i'm unable to return to my original shell as the script which i'm calling inside is invoked in... (5 Replies)
Discussion started by: gurukottur
5 Replies

2. Shell Programming and Scripting

Help need to make a shell script run for ffmpeg vhook watermaking in shell

i have a small problem getting a batxh shell script to run in shell this is the code the problem seems to be centered around the ffmpeg command, something maybe to do with the ' ' wrapping around the vhook part command this is a strange problem , if i take the ffmpeg command and... (1 Reply)
Discussion started by: wingchun22
1 Replies

3. Shell Programming and Scripting

How to run perl code within a shell script...?

Hi, I have a sheel script that invokes a perl script...Now, instead havin the perl script as a separate file I'd like put the contents in the sheel script itself...But I am not sure how ro run that perl script contents.please help me Thanks (1 Reply)
Discussion started by: vijay_0209
1 Replies

4. Shell Programming and Scripting

How to run cmds after changing to a new env (shell) in a shell script

Hi, I am using HP-UNIX. I have a requirement as below I have to change env twice like: cadenv <env> cadenv <env> ccm start -d /dbpath ccm tar -xvf *.tar ccm rcv .... mv *.tar BACKUP but after I do the first cadenv <env> , I am unable to execute any of the later commands . ... (6 Replies)
Discussion started by: charlei
6 Replies

5. Shell Programming and Scripting

Kill a process from parent shell within a shell script

Hi, I am looking for a solution for the following problem: Im Using tcpdump within a shellskript started in a subshell by using brackets: ( /usr/sbin/tcpdump -i ... -c 1 ) - I want the outout of tcpdump saved in a variable - Than tcpdump-Process in the Subshell should be killed - and I... (6 Replies)
Discussion started by: 2retti
6 Replies

6. Shell Programming and Scripting

perl script to check if empty files are created and delete them and run a shell script

I have a local linux machine in which the files are dumped by a remote ubuntu server. If the process in remote server has any problem then empty files are created in local machine. Is there any way using perl script to check if the empty files are being created and delete them and then run a shell... (2 Replies)
Discussion started by: hussa1n
2 Replies

7. Shell Programming and Scripting

Run shell script on different machine using perl script

I want to execute my shell script on remote machine using SSH in perl script. Please help me with syntax. (2 Replies)
Discussion started by: james1988
2 Replies

8. Shell Programming and Scripting

To run a local shell script in a remote machine by passing arguments to the local shell script

I need to run a local shell script on a remote machine. I am able to achieve that by executing the command > ssh -qtt user@host < test.sh However, when I try to pass arguments to test.sh it fails. Any pointers would be appreciated. (7 Replies)
Discussion started by: Sree10
7 Replies

9. Shell Programming and Scripting

Perl program to run a Shell script issues...

Hi all, I have the following Perl script which is intended to run a Shell script and generate some logging for the purposes of tracking weather or not the script ran. I get an error, of course, since I don't know what I'm doing really. Here is the code: #!/opt/perl/bin/perl -w ... (14 Replies)
Discussion started by: zixzix01
14 Replies

10. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies
MAVEN(1)							   User Commands							  MAVEN(1)

NAME
Maven - Creates a link in /usr/share/maven-repo for an existing jar. SYNOPSIS
mh_linkjar [option]... [pom] [dest_jar] [link]... DESCRIPTION
Create symlinks for a jar installed by other means. The symlinks created include links to the jar in /usr/share/maven-repo, at the correct location for Maven. It can also create additional links to the jar, usually located in /usr/share/java. Where [pom] is the location of the POM associated with the jar to install. GroupId, artifactId and version will be extracted from this file. [dest_jar] is the path of the installed jar, usually located in the usr/share/java folder. [link] is an additional link to the jar to install, usually there should be a link to usr/share/java/$jar.jar and usr/share/java/$jar-$version.jar to comply with the Java packaging guidelines. Note that there is no need to specify those particular links if the --java-lib option is used. OPTIONS
-h --help: show this text -V --version: show the version -p<package> --package=<package>: name of the Debian package which will contain this jar file -e<version>, --set-version=<version>: set the version for the jar, do not use the version declared in the POM file. -r<rules> --rules=<rules>: path to the file containing the rules to apply when cleaning the POM. Optional, the default location is debian/maven.rules Maven rules are used here to extract the groupId, artifactId and version from the POM file. -l --java-lib: Optional, if given it will install the jar into /usr/share/java to comply with the Debian Java specification. The jar will be installed as /usr/share/java/$name-$version.jar and a versionless link /usr/share/java/$name.jar will point to it, as well as the links installed in /usr/share/maven-repo -n<name> --usj-name=<name>: Optional, the name to use when installing the library in /usr/share/java when --java-lib is used. Defaults to the artifact id found in the POM. -j<version> --usj-version=<version>: Optional, the version to use when installing the library in /usr/share/java when --java-lib is used. Defaults to the version found in the POM. -s --no-usj-versionless: Optional, don't install the versionless link in /usr/share/java. This flag is used only when the -l or --java-lib option is given. -c<classifier> --classifier=<classifier>: Optional, the classifier for the jar. Empty by default. -v --verbose: show more information while running -n --no-act: don't actually do anything, just print the results --skip-clean-pom: don't clean the pom, assume that a previous action ran mh_cleanpom with the correct options. mh_cleanpom is run only to extract the groupId, artifactId and version of the jar Maven Repo Helper version 1.7.1 January 2012 MAVEN(1)
All times are GMT -4. The time now is 06:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy