This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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 Murach's Java Servlets and JSP this week in the Servlets 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
 
Similar Threads
JAVA_HOME in startManagedWebLogic and setEnv scripts
Initscript
Weblogic 10.2 console is very slow
JVM crash
Using exec task