The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
dynamic editing using shell script habzone2007 Shell Programming and Scripting 1 05-14-2008 07:55 PM
creating dynamic shell script sundarkumars Shell Programming and Scripting 2 02-13-2008 07:28 AM
Accessing variables of one shell script in another shell script rsendhilmani Shell Programming and Scripting 1 04-30-2007 05:43 AM
Shell Script Run Interval to be dynamic rahulrathod Shell Programming and Scripting 5 12-19-2005 02:18 PM
search and replace dynamic data in a shell script csejl Shell Programming and Scripting 8 10-21-2003 07:33 PM

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 01-25-2007
Registered User
 

Join Date: Aug 2005
Posts: 75
Dynamic variables within shell script

Hi Gurus,
I have a requirement of writting the shell script where it should ask me two values

FND_TOP=/d02/app/oracle/xxx/fnd/11.5.0
CDCRM_TOP=/d02/app/oracle/xxx/cdcrm/11.5.0

and then keep these values stored as variables for the execution of rest of the script.

Because, I have to create the soft links from the values derived above.

ln -s VALUE_OF FND_TOP/fnd1 VALUE_OF_CDCRM_TOP/app_link1
ln -s VALUE_OF FND_TOP/fnd2 VALUE_OF_CDCRM_TOP/app_link2

I can't hard code the values of FND_TOP and CDCRM_top in the script, because they will change with every run.

Please help me...

TIA,
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 01-25-2007
Registered User
 

Join Date: Dec 2006
Location: CA,United States
Posts: 168
echo -e "Enter the FND_TOP value : \c"
read FND
echo -e "Enter the CDCRM_TOP value : \c"
read CDCRM

now FND and CDCRM is your two variables.

you can see whether your input value is stored there by just echoing them

echo $FND
echo $CDCRM
Reply With Quote
  #3 (permalink)  
Old 01-25-2007
Registered User
 

Join Date: Aug 2005
Posts: 75
Thanks KrisshV

It worked !!!
Reply With Quote
Google UNIX.COM
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 08:26 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008 The CEP Blog All Rights Reserved -Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0