![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| checking parameter values passed to script | ammu | UNIX for Dummies Questions & Answers | 2 | 10-05-2007 12:35 PM |
| Help!! Need script to read files and add values by lines... | dhuertas | Shell Programming and Scripting | 3 | 09-15-2007 11:14 PM |
| Read from file as script parameter | vmaxx | Shell Programming and Scripting | 2 | 06-25-2005 10:30 AM |
| Korn Shell Script - Read File & Search On Values | run_unx_novice | Shell Programming and Scripting | 2 | 06-15-2005 07:20 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
awk/sed script to read values from parameter files
Hi,
I am writing a shell program that executes a lot of Oracle SQL Files on different databases based on the enviroment setting value. I am trying to design a parameter file where i can store the environment values for all the databases in the below format Environment File File Name oraenv # /* DB1 */ ORACLE_SID=DB1 ORACLE_BASE= ORACLE_HOME= PATH= LD_LIBRARY_PATH= . . Other Parameters # /* End */ # /* DB2 */ ORACLE_SID=DB2 ORACLE_BASE= ORACLE_HOME= PATH= LD_LIBRARY_PATH= . . Other Parameters # /* End */ # /* DB3 */ ORACLE_SID=DB3 ORACLE_BASE= ORACLE_HOME= PATH= LD_LIBRARY_PATH= . . Other Parameters # /* End */ Master Script <-- Main Program that uses these parameters File Name actions.sh When the script is executed as ./actions,sh DB1 i want this to read all the parameters related to DB1 from the oraenv written between the pattern below # /* DB1 */ . ... .. # /* End */ create "export ORACLE_SID .." etc... Any ideas of how best we can do this.... Thanks and Kind Regards, Rajan.S |
|
||||
|
One issue that i am facing with the above code is if i have the following line in my parameter file like
Parameter File content infile # /* DB1 */ ORACLE_HOME=/temp OH=$ORACLE_HOME # /* End */ The below command for LINE in `sed -n '/ '${DB}' /,/ End /p' infile| grep -v ^#`; do export "${LINE}" done works great when it reads line one that is ORACLE_HOME is set to /temp but i expect it to set OH=/temp also but OH gets set to $ORACLE_HOME.Basically it does not translate the $sign read from the parameter file. Any ideas please |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|