. and source


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting . and source
# 1  
Old 08-16-2006
. and source

What's the difference of using "." and "source", such as
". .bashrc" and "source .bashrc"?
# 2  
Old 08-16-2006
From the source manpage, they seem to be equivalent:

Code:
        .  filename [arguments]
       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.  If filename does not contain a slash, file
              names in PATH are used to find the  directory  containing  file-
              name.   The  file  searched  for in PATH need not be executable.
              When bash is  not  in  posix  mode,  the  current  directory  is
              searched  if no file is found in PATH.  If the sourcepath option
              to the shopt builtin command is turned  off,  the  PATH  is  not
              searched.   If any arguments are supplied, they become the posi-
              tional parameters when  filename  is  executed.   Otherwise  the
              positional  parameters  are unchanged.  The return status is the
              status of the last command exited within the  script  (0  if  no
              commands  are  executed),  and false if filename is not found or
              cannot be read.

Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Source .sh file

Dear all, For setting up my working environment, I need to source some files. What i usualy do is to do it manually, cd /setup source setup.sh it take care of everything and I am able to run the commands like root. As it was manual task every time, I defined this in .bashrc itself like... (12 Replies)
Discussion started by: emily
12 Replies

2. Shell Programming and Scripting

Ps command source.

Dear friends, I am using SCO Openserver 5.0.7. Where does the ps -ef command pick the information from? Is it stored in some file? Also, the ps -ef command or the ps -eo args command displays truncated information. How to get the complete expanded output without truncation? Thanks in... (8 Replies)
Discussion started by: sabu
8 Replies

3. UNIX for Advanced & Expert Users

Source Output

Hi all. I am trying to include the output of a command in a shell script (sh shell) but with no success. Scenario is this: I have some XML and binary configuration files and I have an executable who writes a file with some shell variables I usually include in my shell script (executable... (7 Replies)
Discussion started by: ticiotix
7 Replies

4. Shell Programming and Scripting

Source

I have a script in /etc/rc2.d that needs to run on boot up the file looks like this #!/sbin/sh source /abc/scripts/test_env.sh /abc/xyz/run I need to source the test_env.sh script they are both bash how do i do that? 'source /abc/scripts/test_env.sh' I am not too sure (3 Replies)
Discussion started by: deaconf19
3 Replies

5. UNIX Benchmarks

BM source download?

The link to download the source is broken. It's putting me back to the beginning forum page. (2 Replies)
Discussion started by: thywyn
2 Replies

6. Shell Programming and Scripting

read the source name

Hi I'm trying to write a script in which,if i log onto a particular server,the script should automatically find the server i'm on (which is the source server).We can find it frm the path /transfer/common/utilities/env_params.txt please help me as to how start with this,shall i use the read cmmnd... (1 Reply)
Discussion started by: bkan77
1 Replies

7. IP Networking

source quelch

I'm sorry in advance for not having all the information that may be needed to answer this post. At my company we are trying to transfer a large amount of data from an NT server to a HP-UX server using ftp. The problem is that when transferring data we are getting extremely slow speeds of... (1 Reply)
Discussion started by: dangral
1 Replies

8. Solaris

Solaris Source

Back some time ago, Sun had a pay/download Solaris source program. I had participated, but have since lost the source. Does anyone have such that they could make available. Thanks much, Keith (3 Replies)
Discussion started by: kduffin
3 Replies

9. UNIX for Dummies Questions & Answers

qt from source

i'm installing qt from source, and while making i get an error having to do with a "pthread library." what libraries do i need to install for qt to compile, and where can i get them? (1 Reply)
Discussion started by: nydel
1 Replies
Login or Register to Ask a Question