LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-12-2004, 04:08 PM   #1
ashley75
Member
 
Registered: Aug 2003
Posts: 232

Rep: Reputation: 30
so confused about setting up environment


Hi all,

I am so confused about .cshrc and .bashrc. Any way, I have been using .bashrc for my database and application, below is what I have:





#SDE 8.3 number 1
export SDEHOME=/home/sde/sdeexe83
export ORACLE_HOME=/home/oracle/product/9.2.0
export ORACLE_SID=test
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$PATH:$SDEHOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$SDEHOME/lib:$ORACLE_HOME/lib
export ESRI_ARCSDE_LICENSE_FILE=27005@linux


right now, I have one instance running on this server with the a third party application called ESRI, in order to run ESRI service, I have to have the above env setup. So now, I want to add another instance and I want ESRI service running on this instance as well but it seems like I have problem with env. Below is what I have in addition with the env above:


#SDE 8.3 number 2
export SDEHOME=/home/sde/sdeexe83_2
export ORACLE_HOME=/home/oracle/product/9.2.0
export ORACLE_SID=mydummy
export TNS_ADMIN=$ORACLE_HOME/network/admin
export PATH=$PATH:$SDEHOME/bin:$ORACLE_HOME/bin
export LD_LIBRARY_PATH=$SDEHOME/lib:$ORACLE_HOME/lib
export ESRI_ARCSDE_LICENSE_FILE=27005@linux


as you see, I have different Oracle SId b/c I have two instances, and different SDEHOME b/c it required by ESRI. I spoke with one of the ESRI support and they send me the env but it's .cshrc which I told them I am using .bashrc. Below is the .cshrc they sent me based on the bashrc I have sent them:


revised .cshrc file
**************************************************************************************************** *****
.bashrc

# User specific aliases and functions

# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi

alias sde83 setenv VERSION sde83
alias sde83_2 setenv VERSION sde83_2
alias so 'source ~/.cshrc'
export ESRI_LICENSE_FILE 27005@linux

if($?VERSION == 0)then
setenv VERSION sde83
endif

switch ($VERSION)
echo $VERSION

case "sde83"
setenv SDEHOME /home/sde/sdeexe83
setenv ORACLE_HOME ORACLE_HOME /home/oracle/product/9.2.0
setenv ORACLE_SID test
setenv TNS_ADMIN $ORACLE_HOME/network/admin

setenv LD_LIBRARY_PATH /usr/lib:/usr/ucblib:$SDEHOME/lib:$ORACLE_HOME/lib
set path = ( ./ $path /sbin /usr/sbin /usr/bin /usr/ccs/bin /usr/ucb /etc /usr/etc $ORACLE_HOME/bin /usr/local/bin $SDEHOME/lib $SDEHOME/bin /usr/openwin/bin)

setenv SDEINSTANCE esri_sde
setenv ESRI_ARCSDE_LICENSE_FILE 27005@linux
echo ""
echo "Machine is now setup for ArcSDE 83 on Oracle 9.2 on port 5151"
echo ""
echo "**(For ArcSDE 83(second instance) setup type: sde83_2;so )**"
echo ""
set prompt = "$VERSION > "


breaksw

#####SDE 8.3
####export SDEHOME=/home/sde/sdeexe83
####export ORACLE_HOME=/home/oracle/product/9.2.0
####export ORACLE_SID=test
####export TNS_ADMIN=$ORACLE_HOME/network/admin
####export PATH=$PATH:$SDEHOME/bin:$ORACLE_HOME/bin
####export LD_LIBRARY_PATH=$SDEHOME/lib:$ORACLE_HOME/lib
####export ESRI_ARCSDE_LICENSE_FILE=27005@linux


case "sde83_2"
setenv SDEHOME /home/sde/sdeexe83_2
setenv ORACLE_HOME /home/oracle/product/9.2.0
setenv ORACLE_SID mydummy
setenv TNS_ADMIN $ORACLE_HOME/network/admin

setenv LD_LIBRARY_PATH /usr/lib:/usr/ucblib:$SDEHOME/lib:$ORACLE_HOME/lib
set path = ( ./ $path /sbin /usr/sbin /usr/bin /usr/ccs/bin /usr/ucb /etc /usr/etc $ORACLE_HOME/bin /usr/local/bin $SDEHOME/lib $SDEHOME/bin /usr/openwin/bin)

setenv SDEINSTANCE esri_sde2
setenv ESRI_ARCSDE_LICENSE_FILE 27005@linux
echo ""
echo "Pride is now setup for ArcSDE 83_2 on Oracle 9.20 on port 5152"
echo ""
echo " **(For ArcSDE 83 setup type: sde83;so )**"
echo ""
set prompt = "$VERSION > "
endsw




####SDE 8.3 for mydummy
####export SDEHOME=/home/sde/sdeexe83_2
####export ORACLE_HOME=/home/oracle/product/9.2.0
####export ORACLE_SID=mydummy
####export TNS_ADMIN=$ORACLE_HOME/network/admin
####export PATH=$PATH:$SDEHOME/bin:$ORACLE_HOME/bin
####export LD_LIBRARY_PATH=$SDEHOME/lib:$ORACLE_HOME/lib
####export ESRI_ARCSDE_LICENSE_FILE=27005@linux
**************************************************************************************************** *********************


can someone help me to translate the above cshrc to bashrc???

thanks,
 
Old 01-12-2004, 11:12 PM   #2
lyle_s
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 392

Rep: Reputation: 55
GIve this a try:

Code:
# Source global definitions
if [ -f /etc/bashrc ]; then
	. /etc/bashrc
fi

 
alias sde83='export VERSION=sde83'
alias sde83_2='export VERSION=sde83_2'
alias so='source ~/.bashrc'

 
if [ -z "$VERSION" ]
then
	export VERSION=sde83
fi


case "$VERSION" in
 
	sde83)
		export SDEHOME=/home/sde/sdeexe83
		export ORACLE_SID=test
		export SDEINSTANCE=esri_sde
		echo
		echo "Machine is now setup for ArcSDE 83 on Oracle 9.2 on port 5151"
		echo
		echo "**(For ArcSDE 83(second instance) setup type: sde83_2;so )**"
		echo
		;;
  
	sde83_2) 
		export SDEHOME=/home/sde/sdeexe83_2
		export ORACLE_SID=mydummy
		export SDEINSTANCE=esri_sde2
		echo
		echo "Pride is now setup for ArcSDE 83_2 on Oracle 9.20 on port 5152"
		echo
		echo " **(For ArcSDE 83 setup type: sde83;so )**"
		echo
		;;

	*)
		echo Unrecognized version \""$VERSION"\".  Exiting.
		exit 1		
esac 

export ORACLE_HOME=/home/oracle/product/9.2.0
export ESRI_ARCSDE_LICENSE_FILE=27005@linux
export TNS_ADMIN="$ORACLE_HOME"/network/admin
PATH="$PATH":/sbin:/usr/sbin:/usr/bin:/usr/ccs/bin;/usr/ucb:/etc:/usr/etc:"$ORACLE_HOME"/bin:/usr/local/bin:"$SDEHOME"/lib:"$SDEHOME"/bin:/usr/openwin/bin
export LD_LIBRARY_PATH=/usr/lib:/usr/ucblib:"$SDEHOME"/lib:"$ORACLE_HOME"/lib
set PS1="$VERSION > "
Lyle

Last edited by lyle_s; 01-12-2004 at 11:17 PM.
 
Old 01-13-2004, 08:28 AM   #3
ashley75
Member
 
Registered: Aug 2003
Posts: 232

Original Poster
Rep: Reputation: 30
thanks so much.

Ok, how can I switch the env ???? what command I need to type????


could you please let me know how can I learn to write cshrc or bashrc ?????

Many Thanks,

Last edited by ashley75; 01-13-2004 at 09:31 AM.
 
Old 01-13-2004, 11:51 AM   #4
lyle_s
Member
 
Registered: Jul 2003
Distribution: Slackware
Posts: 392

Rep: Reputation: 55
I just blindly/dumbly converted it to bash, so I don't know much about it.

If I understand your question, you type:

sde83_2;so

to switch to the second instance, and:

sde83;so

to switch back.

I'm kind of laughing as I type this because I have little idea what I'm talking about, so I hope that's what you were asking.

Most of what I know about bash scripting came from the Advanced Bash-Scripting Guide found at http://www.tldp.org/LDP/abs/html/.

Lyle
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
setting environment variable kb_ganesh Ubuntu 3 09-10-2005 01:58 PM
Need help setting environment variables. cottonmouth Linux - Newbie 3 12-09-2004 04:54 PM
Setting an environment variable kharris Linux - General 3 10-02-2003 04:38 PM
Setting up samba environment?? deepika Linux - Networking 5 08-26-2003 04:33 PM
HELP! i am really confused by enviroment setting and other things! andym Linux - Newbie 2 05-22-2003 11:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 04:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration