LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
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 12-17-2008, 03:00 AM   #1
guest
Member
 
Registered: May 2003
Distribution: CentOS 5 64 bit
Posts: 255

Rep: Reputation: 30
Is there such thing as php includes file for bash?


I want to have a bash configuration file with a variable set like:
VAR=LQ

and the other bash files would reference
$VAR

and gets LQ

hope i'm explaining this right lol
 
Old 12-17-2008, 08:42 AM   #2
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,136

Rep: Reputation: 230Reputation: 230Reputation: 230
Hi

The bash equivalent of php's "include" is "source".

So if your configuration file is called e.g. "myconfig", use the command "source myconfig" to include it.
 
  


Reply

Tags
bash, includes


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
LXer: Basics 101: ruby python bash perl expect php, How do the exact same thing in th LXer Syndicated Linux News 0 10-05-2008 06:00 AM
bash script includes? MIC_Rulz Linux - Software 2 09-07-2004 05:46 PM
PHP includes lawadm1 Linux - Software 1 08-21-2004 04:20 PM
Bash programming .. multiple includes ?? michael_util Programming 2 08-09-2004 11:47 AM
bash scripting/batch file type thing antken Linux - General 2 01-22-2001 07:56 AM


All times are GMT -5. The time now is 07:32 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration