Same shell script does not working on same server but from different interface..why?


 
Thread Tools Search this Thread
Operating Systems AIX Same shell script does not working on same server but from different interface..why?
# 1  
Old 03-07-2011
Same shell script does not working on same server but from different interface..why?

Hi ,

I have shell script which is perfectly working on unix server prompt. But when i execute it using maestro scheduler with same user , it is giving error of not recognizing the env or local variable.

This is code in script
inbDir=${INTRFACE_DIR}/inbound
zipfile=$inbDir/$1
echo '------------------------------------------------------------------------'
echo 'Zip File Name=' $zipfile
echo '------------------------------------------------------------------------'

O/P of unix prompt
------------------------------------------------------------------------
Zip File Name= /intf/u01/xxx/inbound/cl_cc.zip
------------------------------------------------------------------------

O/P of maestro
------------------------------------------------------------------------
Zip File Name= /inbound/cl_cc.zip
------------------------------------------------------------------------

echo
> echo $INTRFACE_DIR
/intf/u01/xxx

what and where is wrong going on? pls suggest.
# 2  
Old 03-08-2011
Most schedulers in UNIX will have their own environment in which they run commands. This means that variables that are set in your shell at login are NOT available to the scheduler. In your case, the $INTRFACE_DIR variable is not set in maestro.

The best way to avoid these kind of problems is by setting al the variables you need in the script it self. Do not rely on any variables set in any shell.
# 3  
Old 03-08-2011
Just because the environment diff.

in the first line of your scripts add:
./userprofile
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Solaris

How can i get Solaris interface ip using shell script?

HI Community, my server has more than 15 zones and each one is having virtual interface of 10G adapter (qlge0) if the filter the output of ifconfig -a | grep inet, it's showing all interfaces including virtual. i have take first like from the output and assumed that as my main ip is... (3 Replies)
Discussion started by: bentech4u
3 Replies

2. Shell Programming and Scripting

Cp not working in shell script but running perfectly from shell

Dear All, I have script. Dest="" IFS=' ' for translation in $(echo $MY_MAP) do t1=$(echo $translation | cut -d"=" -f1) t2=$(echo $translation | cut -d"=" -f2| cut -d"," -f1) if then Dest=$UNX/$u_product_path/$u_study_path/$UNXTR/$t2 break; ... (4 Replies)
Discussion started by: yadavricky
4 Replies

3. Shell Programming and Scripting

Web Interface for shell script.

Hi Team, I have daily pdf files which i have to convert in tif images. I have script which does it. I need to put these images in some specific folder (which i create manually) on server. Is there any web based way to it, so that user can simply browse file & it will convert & upload on... (1 Reply)
Discussion started by: paragnehete
1 Replies

4. Shell Programming and Scripting

Shell script to copy a file from one server to anther server and execute the binary

Hi , Is there any script to copy a files (weblogic bianary + silent.xml ) from one server (linux) to another servers and then execute the copy file. We want to copy a file on multiple servers and run the installation. Thanks (1 Reply)
Discussion started by: Nawrajesh
1 Replies

5. Shell Programming and Scripting

Shell script trigger using http interface

Hi I have created a shell program, which takes a series of parameters as shown in the below code. Its working good from terminal. My program restorejob.sh -g <NAME> -p <Path-to-search> -r <Path-to-restore> Its working fine from bash shell. I want to extend this functionality like... (1 Reply)
Discussion started by: rakeshkumar
1 Replies

6. Shell Programming and Scripting

User interface for the shell script

Hi, I have written a shell script that does the job of downloading a build file and upgrading a application on my test linux system. This shell is a interactive script where the user needs to enter certain info like the remote system on which the upgrade has to be performed and the build number... (2 Replies)
Discussion started by: sunrexstar
2 Replies

7. Shell Programming and Scripting

Perl script 'system' linking to local shell script not working

Trying to figure out why this works: printpwd.pl #!/usr/bin/perl use CGI::Carp qw( fatalsToBrowser ); print "Content-type: text/html\n\n"; $A = system("pwd"); $A = `pwd`; print "$A\n"; ^^actually that works/breaks if that makes any sense.. i get the working directory twice but when... (5 Replies)
Discussion started by: phpfreak
5 Replies

8. Shell Programming and Scripting

navigating a web interface with a shell script

I'm trying to design a script that will check the external ip address of my home network and then assign it to the A record of a subdomain. When i started, i thought i could do this with SSH, but turns out I don't have ssh access to update the DNS record (not surprising i suppose) So now, i... (2 Replies)
Discussion started by: boyincity
2 Replies

9. Shell Programming and Scripting

how to move a file from one server to another server using FTP in shell script?

I have a file --> file1.txt i need to copy this file to another server using FTP....the 2 servers are server1 and server2..may i know how to write a script that can do this? thanks in advance! Im a newbie to this... (4 Replies)
Discussion started by: forevercalz
4 Replies
Login or Register to Ask a Question