Change Variable Value from Multiple Scripts and Use these Variable


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Change Variable Value from Multiple Scripts and Use these Variable
# 1  
Old 05-31-2012
Question Change Variable Value from Multiple Scripts and Use these Variable

Hi to All,

Please find below details.

file_config.config
export file1_status="SUCCESS"
export file2_status="SUCCESS"

file_one.sh
I am calling another two shell script from these script. I need to pass individual two script status (If it's "FAILED") to file_main.sh.

file_main.sh
I have included file_config.config file
. file_config.config
I need individual execution status from file_one.sh. So, I can do some process base on script status from file_one.sh.

Please guide me.

Thanks & Regards,
Divyang
# 2  
Old 05-31-2012
Have your script print text that the main script reads. That's the usual way to do it, not passing variables after-the-fact.
# 3  
Old 06-01-2012
Thanks for your reply.

Just I would like to add
1. I am using bash shell
2. I am calling file_one.sh from file_main.sh
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to create a variable without multiple concats in a perl scripts that makes a bsub?

The red text at the bottom represents the three lines I want to address. I'm dynamically creating a bsub with a perl script and would like to create the fasta_16S variable in a single line....not three. I'm having difficulty in getting the syntax correct. Obviously, there is some confusion... (3 Replies)
Discussion started by: jdilts
3 Replies

2. Shell Programming and Scripting

TCSH scripts that use the same variable names

If I run two different TCSH scripts simultaneously that use identical variable names will this cause any problems? (1 Reply)
Discussion started by: thibodc
1 Replies

3. Shell Programming and Scripting

Using same variable in 2 different scripts that run at the same time

Hi, I have two scripts that use the same variable. Say suppose I export that variable in script 1 and try to use it in script 2 where I have declared it locally, what will be the effective value of the variable? Will it take the exported value or the locally declared? example: Script1... (4 Replies)
Discussion started by: PraveenSikamani
4 Replies

4. Shell Programming and Scripting

using awk for setting variable but change the output of this variable within awk

Hi all, Hope someone can help me out here. I have this BASH script (see below) My problem lies with the variable path. The output of the command find will give me several fields. The 9th field is the path. I want to captured that and the I want to filter this to a specific level. The... (6 Replies)
Discussion started by: Cowardly
6 Replies

5. Shell Programming and Scripting

Does 2 scripts running at same use a variable with same name conflict?

All, I have a Bash SFTP script that I run and before I would hardcode the file name. I recently decided to put the filename in a variable called $FILENAME. I had 2 scripts that run at the same time and it seems like in the middle of one of the scripts the variable called the other scripts... (2 Replies)
Discussion started by: markdjones82
2 Replies

6. Shell Programming and Scripting

Multiple variable in a variable in Perl

Hi All, I am trying to convert the below Csh while loop into Perl while loop but the problem is that in this csh script, i have 2 variables inside a variable -> $count is a variable {SB$count} as a whole is another variable. Csh is able to assign values to such variable like the below but i do... (3 Replies)
Discussion started by: Raynon
3 Replies

7. Shell Programming and Scripting

[BASH] Holding a variable unto other scripts.

Ex: Script 1 has pID=333. I want to take pID to Script 2 so I can retrive 333. How can I do this? (3 Replies)
Discussion started by: Yakuzan
3 Replies

8. Shell Programming and Scripting

Manipulating a variable across multiple shell scripts

I have a shell script similar to: #!/bin/sh a=1 source a1.sh -- Modifies a source a2.sh -- Modifies a echo "After execution, value of a is $a" What i need is a1.sh script modify the same variable a and same with a2.sh. Now the echo "After execution, value of a is $a" should print the... (1 Reply)
Discussion started by: indianjassi
1 Replies

9. UNIX for Dummies Questions & Answers

usage of same variable in multiple scripts

Hi, I have a .test file which has: #!/bin/ksh export TEST_FLAG=1 In the test1.ksh i have: #!/bin/ksh . .test echo $TEST_FLAG When i execute the test1.ksh its showing the value as 1. But if i refer the same variable in another script, the value is not 1. Basically, I need to have... (1 Reply)
Discussion started by: risshanth
1 Replies

10. Shell Programming and Scripting

How to make the same change in multiple shell scripts?

I would like to make the same change in multiple shell script files and would like to know if anyone can be of some help? I would appreciate it. (4 Replies)
Discussion started by: rdakhan
4 Replies
Login or Register to Ask a Question