![]() |
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 |
| retrive lines from a file using AWK command | swamymns | Shell Programming and Scripting | 1 | 05-04-2008 10:47 PM |
| Parse Text file and send mails | Amruta Pitkar | UNIX for Dummies Questions & Answers | 12 | 08-11-2006 04:56 AM |
| replacing a string in a file with command line parameter | chiru_h | Shell Programming and Scripting | 5 | 08-03-2006 10:34 AM |
| export command | radhika03 | UNIX for Dummies Questions & Answers | 2 | 12-16-2005 09:25 AM |
| using export command | sveera | Shell Programming and Scripting | 4 | 04-01-2005 12:05 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
awk/sed Command : Parse parameter file / send the lines to the ksh export command
Sorry for the duplicate thread this one is similar to the one in
awk/sed script to read values from parameter files Since there were no responses on the parent thread since it got resolved partially i thought to open the new thread for the remaining issue 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... Solution DB=DB1 for LINE in `sed -n '/ '${DB}' /,/ End /p' oraenv| grep -v ^#`; do export "${LINE}" done The problem with the above code is some of the parameters in the oraenv file have $.. Like as below # /* DB1 */ ORACLE_HOME=/temp OH=$ORACLE_HOME # /* End */ Expected result is ORACLE_HOME=/temp OH=/temp Actual results ORACLE_HOME=/temp OH=$ORACLE_HOME I have been struggling to resolve this issue for 4 hrs now... Any quick help is very appreciated. Last edited by rajan_san; 11-06-2008 at 08:49 AM.. Reason: Forgot Content |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|