Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

unix source command  RSS feed

 
Minu Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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!
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24215
37
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing. THere's no difference. "." is just a shortcut for typing "source"
 
Minu Jain
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks
 
Sergey Babkin
author
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!