LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-04-2011, 02:32 AM   #1
barkha_st
LQ Newbie
 
Registered: Aug 2011
Posts: 15

Rep: Reputation: Disabled
Export env_varibales from a file created by me


Hi,

I want to export environment variables from a .env82 file which is created by me.

contents of .env82 file are as below
SCHEMANAME=ABCD
DBNAME=DGOL02.UK.HIBM.HSBC
DSUSER=ABCD
DSPASS=Test1

.env82 file is say placed on Linux box at /opt/Scripts

I need to export these variable into my shell script to create below statement

sqlplus ABCD/Test1@DGOL02.UK.HIBM.HSBC

Can you tell me how can I do this.
 
Old 10-04-2011, 02:41 AM   #2
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976Reputation: 1976
You can add the export statement at the beginning of every line:
Code:
export SCHEMANAME=ABCD
export DBNAME=DGOL02.UK.HIBM.HSBC
export DSUSER=ABCD
export DSPASS=Test1
then you simply have to source this file:
Code:
. /opt/Scripts/scriptname
If you want to do this automatically every time you start a new shell, put the above statement into your $HOME/.bashrc (assuming your default shell is /bin/bash).
 
Old 10-04-2011, 03:42 AM   #3
barkha_st
LQ Newbie
 
Registered: Aug 2011
Posts: 15

Original Poster
Rep: Reputation: Disabled
great.....its working

thanks a mil
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Created /share and /export: isn't this redundant? NightSky Linux - Newbie 2 07-26-2010 01:07 PM
Firefox crash on actions: File -> open file, bookmarks->Manage->Export mak_mailbox Linux - Desktop 2 09-29-2009 05:17 PM
wav file to midi file, midingsolo cannot export chickenlinux Linux - Software 3 12-07-2008 08:27 PM
Bash script for listing FTP usage as the file name of a file created in each share jojothedogboy Programming 1 12-05-2008 04:35 PM
File format of .vnc file created by vncrec rktech83 Linux - Networking 0 08-17-2006 10:16 AM


All times are GMT -5. The time now is 08:24 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration