Env setup script givin wierd results


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Env setup script givin wierd results
# 1  
Old 06-12-2009
Env setup script givin wierd results

I have a script that setsup the environmental variables and then goes on to ftp a file . The scripts which does is as follows

Quote:
###############################################################################
# Assign job variables. #
###############################################################################
env=lglw ;. /apps/lawson/fin/law_setup.env $env
echo $?
#scriptname=dhcftp_new.ksh
#parms="-r -a send -l T -f $DATA_DIR/fromfile -t /ftp-cognew/to file ttcftp01 "

#echo
The script runs fine when i run it in my home dir and goes on to ftp the file..
But when the same file is run as a batch job in Control-M(a job scheduling software used by my client to schedule and run jobs under a 'operator' id) its failing with the following sysout
Quote:
env=lglw
+ . /apps/lawson/fin/law_setup.env lglw
+ [ 0 -ne 1 ]
+ echo
+ echo \tUsage: To setup Lawson environment variables
Usage: To setup Lawson environment variables
+ echo \tSyntax: law_setup.env Env
Syntax: law_setup.env Env
+ echo \tEx: law_setup.env lapt
Ex: law_setup.env lapt
+ echo
+ return 1
/opt/scripts/prod/lglwcogf.sh: cannot return when not in function
law_setup.env fails telling it was not passed any argument. But u can see that it was passed. I am able to find the reason for which this script is getting abended in Control M alone. Can anyone help me>?
# 2  
Old 06-12-2009
Quote:
I am able to find the reason for which this script is getting abended in Control M alone. Can anyone help me>?
And so, what is the reason?

P.S Why do you use for a variable name the name of a UNIX command? (and so should be considered as a reserved word...)
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Env variables in script

Hi All, I have script and it's hardcoded the script ca invoke in user home dir and logs will be redirected to home dir of user. how to make the same script will be invoke from /usr/bin with out chg the logs and other functions path from /user/homedir . code is below: pls check how to... (1 Reply)
Discussion started by: saku
1 Replies

2. Red Hat

sftp jail chroot env setup

Hi I need a specific user to be able to sftp to a server and get files from a specific location. The location is not the users home dir, i don't want the user to be able to view anything else apart from the files in that area. e.g ftp file are is - /logging/phplogs e.g user home is... (1 Reply)
Discussion started by: duckeggs01
1 Replies

3. Web Development

Deny from env=env-variable Does not work

(Above from Apache docs). On my system, using: SetEnvIf User-Agent Mozilla IsBad=1 Order allow,deny Allow from all Deny from env=IsBad ...I see that environment variable is set (using phpinfo()) but the page is still served. No errors in the Apache logs. (1 Reply)
Discussion started by: gnurob
1 Replies

4. Shell Programming and Scripting

Wierd issue using wc -l in a script

Hi experts, This is what Im doing... file_cnt=`cat abc_ | wc -l` head -$file_cnt abc > abc_2 if ; then error "failed on rename abc_ > abc_2" exit 1 fi try_run "rm -f abc_" try_run "mv abc_2 abc_" This is what the output on screen, I get on executing----> + + wc -l... (5 Replies)
Discussion started by: nss280
5 Replies

5. UNIX for Dummies Questions & Answers

Setting env variables using script

Hi, I wrote two small scripts to set env variables in a shell. java_env.csh #!/bin/csh -fn setenv JAVA_HOME '/scratch/software/jdk1.5.0_11' setenv PATH $PATH':'$JAVA_HOME'/bin' and run it using csh ./java_env.csh But the env variables are not set. I tried running each line on the... (5 Replies)
Discussion started by: NoviceAmod
5 Replies

6. Shell Programming and Scripting

Script ENV issue?

Whenever I execute the following korn shell script command I get this error. su - feeduser export: =0: not identifier ** Here is the part of the script with the error ** # Set db type (PRODUCTION, DEVELOPMENT, QA, UA) # unset DB_TYPE_ERROR $HOME/share/$DBS_NAME $ORACLE_SID... (3 Replies)
Discussion started by: soupbone38
3 Replies

7. Shell Programming and Scripting

get env variable from last script

I have 2 scripts t2.sh calls t1.sh. I need to get the vaule of a env variable from t1.sh /tmp/test$ cat t1.sh #!/bin/sh INSTANCE="font/fc-cache" export INSTANCE svcadm disable ${INSTANCE} /tmp/test$ cat t2.sh #!/bin/sh . /tmp/test/t1.sh echo ${INSTANCE} The above works... (9 Replies)
Discussion started by: honglus
9 Replies

8. Shell Programming and Scripting

How to execute script one by one in automated env

I have scripts and when I run mannualy it passed but I would like to run one by one at a time like automated. But When I run in one by one in automated the 1st one is executed and did not jump to 2nd one.Please suggest how to run one by one at a time in automated env. sample of Script ... (1 Reply)
Discussion started by: madhusmita
1 Replies

9. Shell Programming and Scripting

Wierd results with awk

Hey, I'm trying to use awk for some simple file manipulations but i'm getting soem wierd results. So i want to open up a file which looks like this: @relation 'autoMpg' @attribute a numeric @attribute b numeric @attribute c numeric @data -1.170815,0.257522,0.016416... (2 Replies)
Discussion started by: amatheny
2 Replies

10. Shell Programming and Scripting

Adding command line env in cron env

Hello friends, i run two scripts manually & they work. i run them in cron & they don work. how to match the two env's 1.command line env 2.cron env i would like cron to use command line env. Thanks & Regards Abhijeet (1 Reply)
Discussion started by: abhijeetkul
1 Replies
Login or Register to Ask a Question