wood burning stoves 2.0*
The moose likes Linux / UNIX and the fly likes unix source command Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "unix source command" Watch "unix source command" New topic
Author

unix source command

Minu Jain
Ranch Hand

Joined: Mar 24, 2008
Posts: 74
Hi All,
Could anybody please tell me the exact difference between running a shell script with . and running it with source command?
For example, the difference between
. /opt/bea/wlserver_10.3/common/bin/commEnv.sh

and

source /opt/bea/wlserver_10.3/common/bin/commEnv.sh


Thanks in advance!


SCBCD5, SCWCD5, SCJP5
"Even if you're on the right track, you'll get run over if you just sit there."
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

Nothing. THere's no difference. "." is just a shortcut for typing "source"

[Jess in Action][AskingGoodQuestions]
Minu Jain
Ranch Hand

Joined: Mar 24, 2008
Posts: 74
Thanks
Sergey Babkin
author
Ranch Hand

Joined: Apr 05, 2010
Posts: 50
Ernest Friedman-Hill wrote:Nothing. THere's no difference. "." is just a shortcut for typing "source"


It's actually the other way around :-) "." has been there for a long time, and "source" is a newer longer bash-specific way to write it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: unix source command