Passing a command shell parameter to another shell


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Passing a command shell parameter to another shell
# 1  
Old 03-16-2015
Passing a command shell parameter to another shell

Good afternoon, i need your help pls

I want to write a new script that start running as soon as a previus one finish via Autosys (it should be implemented via Autosys too to validate the exsitance and the successful transfered file to a remote server

Whenever the file arrives to the path remote server it
is inmediately processed and moved away,so ive got to list out the name of the file before being moved

The previus script command launched via autosys is sthg like that:

/file/shells/comand.sh jobname (jobname in Autosys which creates the flle and then ftped to the remote server )

as soon the previous command finishes i want mynew script will be triggered to chek out if it was transmitted:

Code:
/file/shells/mycommand.sh jobname #job name is the parameter

The problem ive got is I dont know how to tell mycommad.sh to get the jobname parameter because it does not longer exist and because is launched via Autosys OR how to pass the parameter for the finished command to my new script?

This is the logic so far:

Code:
[case $jobname in 
    invoice)   
                Proccess() 
                verifyftp() 
 
    trafficPrepaid)
                 Process()
                 verifyftp()

     trafficPospaid)
                   process()
                   verifyftp()

      *)
                    do sth

esac

]

Id appreciate your help in advanced



SmilieSmilie

Last edited by Don Cragun; 03-16-2015 at 09:11 PM.. Reason: Add CODE and ICODE tags.
# 2  
Old 03-16-2015
Have you tried looking at the "export" command? Not sure if it might help here.
# 3  
Old 03-17-2015
yeap, i tried but it didnt work either, the problem is the arg $jobname value has 14 options to choose

Id appreciate your help, thanks
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Passing shell script parameter value to awk command in side the script

I have a shell script (.sh) and I want to pass a parameter value to the awk command but I am getting exception, please assist. diff=$1$2.diff id=$2 new=new_$diff echo "My id is $1" echo "I want to sync for user account $id" ##awk command I am using is as below cat $diff |... (1 Reply)
Discussion started by: Sarita Behera
1 Replies

2. Shell Programming and Scripting

Passing a parameter from a shell script to sqlplus

Hi All, I'm new to Linux and scripting, apologies in advance for 'stupid' questions. Please help... Im writing a script that calls a sqlplus script but the sqlplus requires inputs and i cant seem to get this to work. here is my code. #!/bin/sh TERM=vt100 export TERM... (4 Replies)
Discussion started by: Mahomed
4 Replies

3. Shell Programming and Scripting

Passing parameter in background shell

Hi All, i've a shell script, where it will run in the background, i'm using. system("sh $Home/S_SCRIPT/cck.sh $shell_dum_file &"); i'm passing a parameter $shel_dum_file to the background process. In shell script , i'm using. #!/bin/sh FILE=$1 echo "FILE NAME- $FILE" this shell... (2 Replies)
Discussion started by: asak
2 Replies

4. Shell Programming and Scripting

Passing string as a input parameter for a shell script

Hi i have a shell script which needs a string as an input parameter. How to pass the string param as an input? In command line am running the script. for e.g., a="who is a buddy?" sh sample.sh $a Inside the script i get this input param as $1 but only the value "who" is accepted... (12 Replies)
Discussion started by: vidhyaS
12 Replies

5. Shell Programming and Scripting

Passing Parameter containing space in between to Shell Script

Hi, I have one shell script which use two parameter however one of its parameter have space in between. eg. a.sh 20110114 b c d here b c d is one parameter I used 'b c d' but its not giving correct result. Also i tried b\c\d but this one also didnt work. Any help would be... (5 Replies)
Discussion started by: diehard
5 Replies

6. SCO

Parameter passing to dot shell script

OS SCO Open Server 6.0 MP4 I am trying to change the value of a enviornment variable thru a script and want to pass a parameter on the commande line, If I hard code the value inside the script the script changes the enviornment variable . mytest where my test is MYVAR=$1 export MYVAR... (6 Replies)
Discussion started by: atish0
6 Replies

7. AIX

Passing a parameter to a shell script?

I would like to run a compress script on files in certain directories. My compress_script.sh is just basically compress file* In order for me to use this I have to copy it into each directory and run it. How can I state the directory on the command line with the compress script so it... (2 Replies)
Discussion started by: NycUnxer
2 Replies

8. UNIX for Dummies Questions & Answers

Help Passing An Oracle parameter to a unix shell.

I have an Oracle concurrent program that I'm passing a parameter to a unix shell script. An example value of the Oracle parameter is PO_TOP. The Oracle parameter represents the unix env var PO_TOP, meaning, on the unix side there is env var called PO_TOP (ex value: /oradev/apps/po/11.0.3/). My... (7 Replies)
Discussion started by: Mark_Wright
7 Replies

9. Shell Programming and Scripting

Passing parameter from one file to shell script

Hi All, I have a 2 files. File1 i am generating using an ETL tool, which is a comman seperated delimited file which contains country code & load date. everytime, this country code will be updated from a table. It might be AB or BA & ld_date will be for which date we need to load the file. ... (7 Replies)
Discussion started by: Amit.Sagpariya
7 Replies

10. Shell Programming and Scripting

passing parameter 4m shell script to a DB stored procedure

hi all please tell me how to pass parameters 4m shell script to a DataBase stored procedure. To be specific i have sybase DB. i mean i want the syntax of the command.. how to connect to DB, pass user id and password, pass the required parameter to SP.. .. need ur help frnds.. hema (0 Replies)
Discussion started by: hema2026
0 Replies
Login or Register to Ask a Question