Sponsored Content
Top Forums Shell Programming and Scripting Accessing variables of one shell script in another shell script Post 302115948 by anbu23 on Monday 30th of April 2007 08:43:53 AM
Old 04-30-2007
Quote:
Originally Posted by rsendhilmani
Hi All,

I have a shell script called sample1.sh where I have 2 variables. Now I have another shell script called sample2.sh. I want the variables in sample1.sh to be available to sample2.sh.

For example. In sample1.sh I am finding the sum of 2 numbers namely a and b. Now I want to access these variables in sample2.sh. Is this possible? How can I do this?

Thanks in advance.
sample2.sh
Code:
. sample1.sh
.....

If you have only variables in sample1.sh, then you can use above code, else keep all the variables in one file and replace sample1.sh by that file name in above code.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Accessing the parameters of a shell script

Hi, I have one situation. I am developing a shell script to which parameters will be passed from a Web based User Interface using some Business Process(BP).There are some 6 parameters for which user will enter the values in UI. These values will be passed to script by BP in the form -... (2 Replies)
Discussion started by: The Observer
2 Replies

2. Shell Programming and Scripting

Accessing variables of one shell script in another shell script

I have a variable $exe in a shell script file a.sh which I need to access in another shell script file b.sh. How can I do that? :rolleyes: Thanks!! (2 Replies)
Discussion started by: looza
2 Replies

3. Shell Programming and Scripting

Problem in accessing variables outside shell

Hi, I have a shell script wherein i am doing some file operations and storing the data in some variables. I am exporting these variables as i need to use them outside shell. Then within the shell i am launching GDB session hoping that i will be able to access the exported variables in the GDB... (2 Replies)
Discussion started by: jsantosh
2 Replies

4. Shell Programming and Scripting

Accessing aliases within a shell script

I am not able to access the aliases in my environment within a Python script. If I pass the alias to os.system(), I get a message saying "sh: x: not found". I've tried sourcing my .bashrc file in the script, but this does not work. I would perfer not to source my or any rc file because this... (9 Replies)
Discussion started by: cooldude
9 Replies

5. Shell Programming and Scripting

problem accessing Multiple Variables from C Program to a Shell script

program name--test #!/bin/bash output1=`/home/user/a.c` output2=`/home/user/a.c` k=`$output1 + 1` m=`$output2 + 1` echo $k echo $m --------------------------------------------------------------------------- prgram name--a.c #include<stdio.h> int main() (1 Reply)
Discussion started by: sameworld1980
1 Replies

6. Shell Programming and Scripting

Accessing php script from shell script

Hi I'm a newb to php scripts. My task requires me to run a shell script from within the php script which I believe I've figured out. What I'm trying to do now is output something to the web page from the called shell script. when I use "echo" from the called shell script I don't get any output... (3 Replies)
Discussion started by: airon23bball
3 Replies

7. UNIX for Advanced & Expert Users

Accessing PL/SQL OUT variables in Korn Shell Script

Hello All, I was just wondering if there is any direct way to access PL/SQL OUT variables from Korn Shell Script. I could already figure out how to return a single value back from PL/SQL to Shell Script (using bind variable). But, what if we want to return multiple values? One option I... (4 Replies)
Discussion started by: bright_future
4 Replies

8. UNIX for Advanced & Expert Users

Accessing secured server using shell script

Hi, I was trying to connect secure server using SFTP, but end up in error. Im looking for a shell script which will connect my secured FTP server For EG: hostname = example.com username = fed password = pass port = 993 Destination = web Push some tar file into web folder which is in... (3 Replies)
Discussion started by: Paulwintech
3 Replies

9. UNIX for Dummies Questions & Answers

How to write Config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies

10. Shell Programming and Scripting

How to write config shell script to pass variables in master shell script?

Dear Unix gurus, We have a config shell script file which has 30 variables which needs to be passed to master unix shell script that invokes oracle database sessions. So those 30 variables need to go through the database sessions (They are inputs) via a shell script. one of the variable name... (1 Reply)
Discussion started by: dba1981
1 Replies
asadmin-create-virtual-server(1AS)				   User Commands				asadmin-create-virtual-server(1AS)

NAME
asadmin-create-virtual-server, create-virtual-server - adds the named virtual server SYNOPSIS
create-virtual-server --user admin_user [--password admin_password] [--host localhost] [--port 4848] [--secure|-s] [--passwordfile file- name] [--terse=false] [--echo=false] [--interactive=true] --hosts hosts [--httplisteners http_listeners] [--defaultwebmodule default_web_module] [--state on] [--logfile log_file] [--property (name=value)[:name=value]*] virtual_server_id Creates the named virtual server. Virtualization in the Application Server allows multiple URL domains to be served by the same HTTP server process which is listening on multiple host addresses. If the application is available at two virtual servers, they still share the same physical resource pools. This command is supported in remote mode only. OPTIONS
--user authorized domain application server administrative username. --password password to administer the domain application server. --host machine name where the domain application server is running. --port port number of the domain application server listening for administration requests. --secure if true, uses SSL/TLS to communicate with the domain application server. --passwordfile file containing the domain application server password. --terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well- formatted data for consumption by a script. Default is false. --echo setting to true will echo the command line statement on the standard output. Default is false. --interactive if set to true (default), only the required password options are prompted. --hosts a comma separated (,) list of values allowed in the host request header to select the current virtual server. Each virtual server that is configured to the same connection group must have a unique hosts value for that group. --httplisteners optional; a comma separated (,) list of HTTP listener IDs. Required only for a virtual server that is not the default virtual server. --defaultwebmodule standalone web module associated with this virtual server by default. --state determines whether a virtual server is active (on) or inactive (off or disabled). Default is active (on). When inactive, the virtual server does not service requests. --logfile name of the file where the log has to be written to. --property optional attributes name/value pairs for configuring the connection pool. OPERANDS
virtual_server_id identifies the unique ID for the virtual server to be created. This virtual server ID cannot begin with a number. Example 1: Using create-virtual-server asadmin> create-virtual-server --user admin1 --password adminadmin1 --host pigeon --port 5001 --httplisteners http-listener-1 --defaultwebmodule simple --state on --logfile server.log --property User=admin:Password=admin --hosts sample1,sample2 sample_vs1 Command create-virtual-server executed successfully Where sample_vs1 is the virtual server created. EXIT STATUS
0 command executed successfully 1 error in executing the command asadmin-delete-virtual-server(1AS), asadmin-list-virtual-server(1AS) J2EE 1.4 SDK March 2004 asadmin-create-virtual-server(1AS)
All times are GMT -4. The time now is 06:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy