LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
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 06-26-2004, 12:23 PM   #1
hq4ever
Member
 
Registered: May 2004
Location: Israel
Distribution: Debian
Posts: 98

Rep: Reputation: 15
what the command [source] does ?


it has nothing to do with "compile from source", right?
i tried to man, info for it but that didn't told me anything.

what [source ... ] does & how / when should i use it ?

thank you.
 
Old 06-26-2004, 03:03 PM   #2
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Rep: Reputation: 45
First of all, you need to phrase your questions well. That would help you fetch better answers.

Now, if you do
man source

You will find the manual page of source. The man pages are your best friend. Scroll down a little and you find the description of source
#source filename [arguments]
Read and execute commands from filename in the current shell
environment and return the exit status of the last command exe-
cuted from filename.
 
Old 06-26-2004, 03:33 PM   #3
hq4ever
Member
 
Registered: May 2004
Location: Israel
Distribution: Debian
Posts: 98

Original Poster
Rep: Reputation: 15
thanks,

LinuxLala, how would you prefer i asked the question?
if it wasn't clear enough from the title then sorry i tried to do this as informative as possible.


now about [man source], believe me i did this, i also did [info source] & i searched linuxquestion for posts about the command (as you might guess posts with the word source are not hard to find in linux forum)
now look i'm copying (by hand) from my linux screen onto my xp machine because i do not know how to get a linux
shell from windows yet .

Quote:
$ man source

BASH_BUILTINS(1)

NAME
bash, :, ., [, alias, bg, bind, break, builtin, cd, command, compgen,
complete, continue, declare, dirs, disown, echo, enable, eval, exec,
exit, export, fc, fg, getopts, hash, help, history, jobs, kill, let,
local, logout, popd, printf, pushd, pwd, read, readonly, return, set,
shift, shopt, source, suspend, test, times, trap, type, typeset,
ulimit, umask, unalias, unset, wait - bash built-in commands, see
bash(1)
SEE ALSO
bash(1), sh(1)
you see when i type [man source] i get a list of all the basic commands available to me from bash and nothing more, this is on mandrake 10.0.
 
Old 06-26-2004, 04:05 PM   #4
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Source is a bash builtin command, and all those commands are grouped together into one man page. If you had scrolled down, you would have seen a description of what source does. As LinuxLala says, it executes a file in the current bash shell environment. It's mostly useful for configuring environment -- for instance, I might want to make a bunch of custom aliases, or tweak my PATH or whatever. I would put the commands to do so in my .bashrc file, but that only gets read when I login or start a new shell. If I want my new things to apply to the shell I'm working under now, I do source .bashrc and that runs the .bashrc and applies any new aliases or environment variable settings to my current terminal session.

BTW -- you should look into ssh as a way to get a terminal on your Linux machine from a separate Windows machine.
 
Old 06-26-2004, 04:09 PM   #5
LinuxLala
Senior Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: Fedora 7
Posts: 1,305

Rep: Reputation: 45
If only you scroll down, using the down arrow key 'coz mouse scroll doesn't work, comes the description I gave.

http://man.he.net/?topic=source&section=all

This is some online man page for source. Don't know how old this is

About me saying you didn't frame your question right, I mean't
Quote:
what [source ... ] does & how / when should i use it ?
I didn't understand the / part.

I understand how difficult it can be to search at LQ BTW, what Linux distribution are you running?

[EDIT}: The perils of keeping tabs open for too long and not replying sooner, someone else posts sooner, the same thing

btmiller, you are right, Cheers.

Last edited by LinuxLala; 06-26-2004 at 04:12 PM.
 
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Where i can get source code of the 'cp' command? chaits Linux - General 5 11-22-2010 09:50 PM
about the source command kpachopoulos Linux - General 2 06-12-2005 08:16 PM
Linux Command Source Codes GodSendDeath Slackware 1 03-12-2004 03:12 AM
Where is source for 'who' command grittkmg Programming 2 10-15-2003 01:49 PM
What is the source (Bash) command do ? Linh Linux - General 5 06-09-2003 04:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:20 AM.

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