how to include a file containing variables in a shell script

Mercer

i have many script shell and i want to include a file containing variables in this shell

script?

My var script:

###################################################################################
ORACLE_LOGIN=login
ORACLE_PWD=pwd
CHEMIN_1="/home/"
CHEMIN_2="/scripts/"
LOG_FILE="$CHEMIN_1/max.log"
export ORACLE_SID=oracle_sid
###################################################################################

My script sh:

#!/bin/ksh
#set -x

# ==============   LOAD VAR HERE  ====================================
????

##################################################################
####                          Begin                           ####
##################################################################

write "Begin $0"  

$ORACLE_HOME/bin/sqlplus -s $ORACLE_LOGIN/$ORACLE_PWD@$ORACLE_SID <<EOF >> $LOG_FILE 2>&1 
@$CHEMIN_2/sp_rep_alim_dia_date_max.sql
exit
EOF

write "End."

Thx.

ams

It depends which shell, but one of these two usually works:

. var

or

source var

I'm not sure about ksh, but I'd imagine both would work.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

files containing variables shell script

From Dev

grepping variables containing special characters in a shell script

From Dev

sed with external script file - How to apply shell variables?

From Dev

sed with external script file - How to apply shell variables?

From Dev

How do you use variables with values containing spaces in a Z-shell (zsh) script command?

From Dev

How to dynamically include a html file containing javascript

From Dev

Curl shell script not giving variables to php file

From Dev

Shell script to migrate config file variables

From Java

how to include path of a directory containing files inside bash script

From Dev

shell script variables - how to finalize substituition

From Dev

shell script variables - how to finalize substituition

From Dev

How to export environmental variables in a Posix shell script?

From Dev

How to run a java jar file and get store the output in shell script variables

From Dev

How to include config file for variables in Lua

From Dev

How to pass an argument containing double quote to a shell script function?

From Dev

How to include PHP script in HTML file with WampServer?

From Dev

How to include .h file containing structure only in to static library

From Dev

How to include .h file containing structure only in to static library

From Dev

How to pass shell variables as Command Line Argument to a shell script

From Dev

How to pass shell variables as Command Line Argument to a shell script

From Dev

How to include a sub-script in a remote shell from remote location?

From Dev

Running shell script: How to include commands in the output as if typed interactively

From Dev

Need to read a file and use results as named variables in a shell script

From Dev

Referencing variables in a shell script

From Dev

Looping a for with variables on a shell script

From Dev

Boolean variables in a shell script

From Dev

shell script - how to use variables for a shell script without defining the variable in the script

From Dev

how to pass variables to an include file from every parent file laravel

From Dev

How to sort file with temporary locale in shell script?

Related Related

  1. 1

    files containing variables shell script

  2. 2

    grepping variables containing special characters in a shell script

  3. 3

    sed with external script file - How to apply shell variables?

  4. 4

    sed with external script file - How to apply shell variables?

  5. 5

    How do you use variables with values containing spaces in a Z-shell (zsh) script command?

  6. 6

    How to dynamically include a html file containing javascript

  7. 7

    Curl shell script not giving variables to php file

  8. 8

    Shell script to migrate config file variables

  9. 9

    how to include path of a directory containing files inside bash script

  10. 10

    shell script variables - how to finalize substituition

  11. 11

    shell script variables - how to finalize substituition

  12. 12

    How to export environmental variables in a Posix shell script?

  13. 13

    How to run a java jar file and get store the output in shell script variables

  14. 14

    How to include config file for variables in Lua

  15. 15

    How to pass an argument containing double quote to a shell script function?

  16. 16

    How to include PHP script in HTML file with WampServer?

  17. 17

    How to include .h file containing structure only in to static library

  18. 18

    How to include .h file containing structure only in to static library

  19. 19

    How to pass shell variables as Command Line Argument to a shell script

  20. 20

    How to pass shell variables as Command Line Argument to a shell script

  21. 21

    How to include a sub-script in a remote shell from remote location?

  22. 22

    Running shell script: How to include commands in the output as if typed interactively

  23. 23

    Need to read a file and use results as named variables in a shell script

  24. 24

    Referencing variables in a shell script

  25. 25

    Looping a for with variables on a shell script

  26. 26

    Boolean variables in a shell script

  27. 27

    shell script - how to use variables for a shell script without defining the variable in the script

  28. 28

    how to pass variables to an include file from every parent file laravel

  29. 29

    How to sort file with temporary locale in shell script?

HotTag

Archive