Today (Saturday) We will make some minor tuning adjustments to MySQL.

You may experience 2 up to 10 seconds "glitch time" when we restart MySQL. We expect to make these adjustments around 1AM Eastern Daylight Saving Time (EDT) US.


How to pass values to a script called from within another script in shell?


Login or Register to Reply

 
Thread Tools Search this Thread
# 1  
How to pass values to a script called from within another script in shell?

Usually it's best to show what you've tried and where you failed, so people know where to start guiding / helping you. On top, describe your request more detailedly. E.g. what do you mean by "populate a pre-defined value from another file"? Pls explain in depth!


Just executing a script from within another script will do so in a subshell, which can inherit variables exported by the caller, but there's no such channel back. There are several ways to get some info back to the caller, though (for the bash shell, not necessarily available in others):
- use "command substitution" to intercept the second script's stdout and e.g. assign it to a (one!) variable.
- source the script, so no subshell will be created / used.
# 2  
I am guessing this post really belongs in another thread. Somewhere. Anybody know? We can move into its proper home
Login or Register to Reply

|
Thread Tools Search this Thread
Search this Thread:
Advanced Search

More UNIX and Linux Forum Topics You Might Find Helpful
How to pass values to a script called from within another script in shell?
sankasu
Need ideas on how to achieve the below. We have a script say "profile.sh" which internally calls another existing script called "name.sh" which prompts for the name and age of a person upon execution. When i run profile.sh how can i populate a pre-defined value from another file and pass that...... UNIX for Beginners Questions & Answers
1
UNIX for Beginners Questions & Answers
Shell script to pass the config file lines as variable on the respective called function on a script
sadique.manzar
I want to make a config file which contain all the paths. i want to read the config file line by line and pass as an argument on my below function. Replace all the path with reading config path line by line and pass in respective functions. how can i achieve that? Kindly guide. ...... Shell Programming and Scripting
6
Shell Programming and Scripting
Pass values from web form to shell script
tdev457
Hi, is it possible to pass more values from web form like textbox to shell script and if yes,how to do that.:confused::confused::confused:... Shell Programming and Scripting
2
Shell Programming and Scripting
How to pass pl/sql table values to shell script
rosalinda
Hello, i am using '#!/bin/bash', i want to make a loop in pl/sql, this loop takes values from a table according to some conditions, each time the loop choose 3 different variables. What i am not able to do is that during the loop i want my shell script to read this 3 variables and run a shell...... Shell Programming and Scripting
1
Shell Programming and Scripting
need help on shell script(to pass the values)
sai123
only the arguments that are written to the file, my script is (sh /u01app/wkf.sh"$start_no","$name","$Condition","$file_name") like that when ever I run my script I need to write into a new file every time, like wise I have upto10 files with different names.bec my $start_no and $name will...... Shell Programming and Scripting
1
Shell Programming and Scripting

Featured Tech Videos