Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

unix source command

 
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
Marshal
Pie
Posts: 24208
35
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