Invoking 2 scripts in 1 command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Invoking 2 scripts in 1 command
# 1  
Old 03-19-2009
Invoking 2 scripts in 1 command

HI,
I have 2 scripts main.sh and sub.sh, I want to invoke both these scripts in 1 unix command..
Something like... csh -f main.sh(sub.sh TIBCO)
sub.sh returns a value as .., by taking this value main.sh prints a text.
Can anyone help me to build this command
Below are the scripts
////sub.sh
#! /usr/bin/csh
set VAR_NAME=$1
eval echo \$$VAR_NAME

////main.sh
#! /usr/bin/csh
set VAR_NAME=$1
echo printing the value $VAR_NAME

Thanks in advance
# 2  
Old 03-19-2009
$main.sh ; sub.sh
# 3  
Old 03-19-2009
HI ,

I tried calling the script as below and getting error

csh -f $main.sh ; sub.sh TIBCO_HOME
main: Undefined variable.

Thanks
# 4  
Old 03-20-2009
you can store the output of subscript in a variable user the main sript

////main.sh
#! /usr/bin/csh
VAR_NAME=`sub.sh`
echo printing the value $VAR_NAME
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Invoking system(cmd) inside awk command

Hi, I was searching for a way to grep 2 lines before and after a certain keyword, and I came across the following code.. awk "\$0 ~ /ORA-/ { cmd=\"awk 'NR>=\" NR-2 \" && NR<=\" NR+2 \"' init.ora\" system(cmd) }" input_file I could not understand how this works. What is system() ? what... (2 Replies)
Discussion started by: Kulasekar
2 Replies

2. UNIX for Dummies Questions & Answers

Need equialent command for batch scripts

Hi Friend, what is the equivalent command for batch scripting of tail -1. for example : i have a.txt file with below the contents. i need to print last line --------------------------------- Use descriptive thread titles when posting. For example, do not post questions with subjects like... (3 Replies)
Discussion started by: Jewel
3 Replies

3. Shell Programming and Scripting

Command need to be used for the scripts output differences

Hi All, Actually we want to know the command need to use if the difference between two files are null, then it should not send as mail. Oterwise it should send as mail alert. Below for your reference, # Email the spoolfile. diff free_sp_new.log free_sp_old.log if output of above... (1 Reply)
Discussion started by: thanvir.akram
1 Replies

4. Shell Programming and Scripting

ps command in scripts

I want to write 2 scripts that: script named "users" - List of users logged into the system; script named "ps" - List of all processes in the operating system; # is it true? #!bin/bash echo 'content-type: text/html' echo users # for script named users #!bin/bash echo 'content-type:... (15 Replies)
Discussion started by: numeracy
15 Replies

5. Shell Programming and Scripting

Help needed in invoking shell command in PHP

Hi all.. can u please let me know how to use the unix shell curl command in PHP scripting, sample of my code is given below, <?php $ch = shell_exec('curl -H "Content-type: application/json" -H "Accept: application/json" --data-binary '{"text" : "how to check the temperature?"}' -H... (5 Replies)
Discussion started by: vidhyaS
5 Replies

6. Shell Programming and Scripting

Running shell scripts from command

I have written a few shellscripts to run a videogame (starcraft) at different patched versions. For example bw113 runs the 1.13 version of the game. These works perfectly when I run them from command line (./bw113). However I cannot get it to work via mouseclick. Some Information: - I have... (5 Replies)
Discussion started by: lordsloth
5 Replies

7. Shell Programming and Scripting

Shell script..invoking command and exiting at fixed intervals

Hi, I need to write a shell script. Based on command line param to script say demode=yes Need to run an ant command for an hour(configurable) Then exit Again run the ant command all this needs to be in a loop. Thanks in advance Raj (1 Reply)
Discussion started by: rajuak12
1 Replies

8. UNIX for Advanced & Expert Users

Invoking shell script with perl command.

Hi All, I am using the following command to invoke the shell script from a perl command. perl -i.bak -pe'BEGIN { $cmd = "/opt/coreservices/tomcat-5.5.9/bin/digest.sh -a sha"; } s/(password=")(*)/ $1.`$cmd $2|cut -d: -f2|tr -d "\n"` /e ' $CATALINA_HOME/conf/tomcat-users.xml I need... (1 Reply)
Discussion started by: nua7
1 Replies

9. Shell Programming and Scripting

exit status of Invoking two or more scripts in background

I have a sript which is going to trigger other 3 scripts in background simultaneously for eg: Main Script:(main.sh) ----------- sh a.sh & sh b.sh & sh c.sh & How to catch the exit status and store it in a variable for all those three scripts in main script. Is there any other way of... (4 Replies)
Discussion started by: Omkumar
4 Replies

10. Shell Programming and Scripting

BUILT-IN command scripts

I am new to Unix scripting. I would like to know if someone can point me to a site which lists any built-in commands in there scripted form. I thought to start with the basics and learn from example. Thanks JSP (2 Replies)
Discussion started by: JSP
2 Replies
Login or Register to Ask a Question