Sponsored Content
Top Forums Shell Programming and Scripting Dynamically changing environment variable Post 302960093 by guessingo on Tuesday 10th of November 2015 02:29:26 PM
Old 11-10-2015
Dynamically changing environment variable

Linux Redhat, BASH Shell.

I want to put this in my .bash_profile

I have log files that go to directory paths based in part on other variables such as went DB Name is set in memory. So if the DB Name changes the path to the log file changes. How do I create an environment variable I put into .bash_profile that will change dynamically when another parameter changes?

if I do this, it only checks for $ORACLE_SID, the first time the .bash_profile is run.
ORACLE_SID=mydb
LOG_DIRECTORY=/var/opt/$ORACLE_SID/logfile.log

so
echo $LOG_DIRECTORY=/var/opt/mydb/logfile.log

If the SID changes, I need the $LOG_DIRECTORY variable in memory to change also. I don't want to do it manually. I would like the parameter to change that is from the .bash_profile

I need ORACLE_SID, to change dynamically whle the $LOG_DIRECTORY is in memory
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

dynamically creating a variable name

Hi ! I have the following situation - ##First variable variableA=JOB_A ##bunch of other variable JOB_A_RESTART=cleanupJobA JOB_B_RESTART=cleanupJobB JOB_C_RESTART=cleanupJobC now i need a script which would - 1. take the first variable 2. create a new variable name... (2 Replies)
Discussion started by: hsahay
2 Replies

2. Shell Programming and Scripting

changing environment variables

hi friends, i'm new to shell scripting,can i know how to change the environment variables without altering anythng in .bash_profile as the change in it is for a specific user but i want the change to be available to every user who logs in. bye. (1 Reply)
Discussion started by: amit4g
1 Replies

3. Shell Programming and Scripting

How to read a dynamically changing file and load into Oracle?

I have a tab delimited file which has 27 character fields. The file needs to be loaded into an Oracle table. But the challenge is that everytime the file comes it may or may not have values in all 27 fields. Column Definition of the 27 fields: TYPE: Char (1) NAME: Char (30) CUSTOM_VAL: Char... (8 Replies)
Discussion started by: madhunk
8 Replies

4. Shell Programming and Scripting

Adding string variable dynamically in for loop

Hi, I need to generate the text name dynamically in for loop, ex, VAR_COPY_FILE1= file path 1 VAR_COPY_FILE2= file path 2 VAR_COPY_FILE3= file path 3 for i in 1 2 3 do if then "do some process here" fi done (3 Replies)
Discussion started by: msubash26
3 Replies

5. Shell Programming and Scripting

Expand an environment variable in sed, when the variable contains a slash

I'm trying to make a sed substitution where the substitution pattern is an environment variable to be expanded, but the variable contains a "slash". sed -e 's/<HOME_DIRECTORY>/'$HOME'/'This gives me the following error: sed: -e expression #1, char 21: unknown option to `s'Obviously this is... (2 Replies)
Discussion started by: Ilja
2 Replies

6. Shell Programming and Scripting

BASH - Reference external variable name dynamically

Hi there, I have included an external properties file into my BASH script via the 'source' command. I am attempting to dynamically assign a variable in the BASH script, that references the variable name within the external properties file i.e. #!/bin/bash pth=${0%/*} source... (3 Replies)
Discussion started by: mjwoodford
3 Replies

7. Red Hat

Changing Desktop Environment by mistake

Hi, I'm using fedora 15, my defualt DE is XFCE I once saw that there is a option in startup DE's that I can select and it was OPENBOX. I just wanted to test it. but after choosing it as my DE here I am. I have just access to terminal, firefox.. what's in my desktop. there is no panel here. I... (0 Replies)
Discussion started by: hoseinit
0 Replies

8. Shell Programming and Scripting

Dynamically setting of environment variable... Can it be done?

Hi all, I am fairly new to unix scripting and will like to know how to dynamically set the name of an environment variable to be used. We have a .env file where we defined the names and locations of data files, trigger files, directories .... etc Example of variables defined in .env... (4 Replies)
Discussion started by: Morelia
4 Replies

9. Shell Programming and Scripting

How to read a dynamically changing file

I want to read a constantly changing file and do some operation on text found in that file. Actually that is log file of linux system and whenever i find a matching string in that file i want to create a text file with timestamp. is it possible to read that file? here is sample output of log... (7 Replies)
Discussion started by: kashif.live
7 Replies
globus_gram_job_manager_configuration(3)		      globus gram job manager			  globus_gram_job_manager_configuration(3)

NAME
globus_gram_job_manager_configuration - Job Manager Configuration The Job Manager is generally configured using the setup-globus-gram-job- manager setup script. This section of the Job Manager manual describes all options which may be passed to the GRAM Job Manager in the configuration file $GLOBUS_LOCATION/etc/globus-job-manager.conf. Configuration File Options -k Indicate that the job manager was built with the kerberos GSSAPI instead of GSI. This disables checks for a delegated GSI credential. -home GLOBUS_LOCATION Set the GLOBUS_LOCATION environment variable to the specified Globus-Location. -target-globus-location GLOBUS_LOCATION Set the GLOBUS_LOCATION environment variable to the execution node's GLOBUS_LOCATION, if different than the GRAM node's GLOBUS_LOCATION -type JOB_MANAGER_TYPE Set the type of scheduler interface to use for this job manager. A similarly named Perl module in the $GLOBUS_LOCATION/lib/perl/Globus/GRAM/JobManager/ directory is needed. -history PATH Set the path to the directory to store job history files. -cache-location PATH Set the path for the GASS cache. This path must be unique for each user. RSL substitutions (such as /tmp/buildd and pbuilder) may be used in this path. See RSL Substitions for a list of available RSL substitutions. -extra-envvars VAR1[=VAL],VAR2,... The Job manager will attempt to get the listed VARs from its environment and set them the same for the job's environment. For example, -extra-envvars LD_LIBRARY_PATH,GLOBUS_TCP_PORT_RANGE -scratch-dir-base PATH Set the default scratch directory root for the job manager. Job-specific scratch directories will be created as a subdirectory of this directory. RSL substitutions (such as /tmp/buildd and pbuilder) may be used in this path. See RSL Substitions for a list of available RSL substitutions. If this option is not present in the configuration file, then the job manager will create scratch directories as subdirectories of the user's home directory. -condor-arch ARCH Set the condor architecture for this job manager to be the specified ARCH. This is optional when the job manager type is condor. -condor-os OSNAME Set the condor operating system name for this job manager to be the specified OSNAME. This is optional when the job manager type is condor. -globus-gatekeeper-host HOST Set the name of the gatekeeper host. This will be made available in the GLOBUS_GATEKEEPER_HOST RSL substitution. -globus-gatekeeper-port PORT Set the TCP port of the gatekeeper. This will be made available in the GLOBUS_GATEKEEPER_PORT RSL substitution. -globus-gatekeeper-subject SUBJECT Set the GSI subject name of the gatekeeper. This will be made available in the GLOBUS_GATEKEEPER_SUBJECT RSL substitution. -globus-host-manufacturer MANUFACTURER Set the manufacturer name of the host machine. This will be made available in the GLOBUS_HOST_MANUFACTURER RSL substitution. -globus-host-cputype CPUTYPE Set the cpu type of the host machine. This will be made available in the GLOBUS_HOST_CPUTYPE RSL substitution. -globus-host-osname OSNAME Set the operating system name of the host machine. This will be made available in the GLOBUS_HOST_OSNAME RSL substitution. -globus-host-osversion OSVERSION Set the operating system version of the host machine. This will be made available in the GLOBUS_HOST_OSVERSION RSL substitution. -globus-tcp-port-range RANGE Set the range of TCP port numbers which the job manager will use. This will also be made available in the GLOBUS_TCP_PORT_RANGE environment variable and RSL substitution. -globus-tcp-source-range RANGE Set the range of TCP source port numbers which the job manager will use. This will also be made available in the GLOBUS_TCP_SOURCE_RANGE environment variable and RSL substitution. -state-file-dir PATH Set the path to store job manager state files (used for restarting a job manager which fails). If this is not set, then job state files will be stored in the $GLOBUS_LOCATION/tmp/gram_job_state directory. -x509-cert-dir PATH Set the path to the X.509 trusted certificate directory on the job execution hosts. If not present, then the trusted certificate directory used by the job manager (usually set by the Gatekeeper) will be used -seg-module MODULE Use the named module as a way to interact with the scheduler instead of polling for job status. -audit-directory DIRECTORY Store job auditing records in DIRECTORY. This directory should be sticky and group writable but not group readable. Audit records can be uploaded to a database by using the globus-gram-audit command. -globus-toolkit-version VERSION-STRING Use the string VERSION-STRING as the toolkit version in audit records. -enable-syslog Send log messages to the system log. -stdio-log LOG_DIRECTORY Obsolete way to set the directory for writing log messages. Messages will be written to LOG_DIRECTORY/gram_DATE.log. Use -log-pattern instead -log-pattern PATTERN RSL-substituted pattern for naming log files. Possible variables are HOME, LOGNAME, DATE. The -stdio-log is equivalent to -log-pattern /tmp/buildd/gram_.log -log-levels [FATAL|ERROR|WARN|DEBUG|INFO|TRACE] List of log levels to enable site-wide. These may be joined by the '|' character. Version 13.33 Mon Apr 30 2012 globus_gram_job_manager_configuration(3)
All times are GMT -4. The time now is 11:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy