-2

I've been studying the bash scripting then i noticed using the period wildcard in the bash script, in my sense the period treated as current directory,

I have snippet

if ! shopt -oq posix; then
  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi
fi

. /etc/bash_completion In this script what is the use of the (.), period.

Ajil Raju
  • 37
  • 1
  • 2
  • 9

1 Answers1

2

. is used to source a file:

. /etc/bash_completion

is the same as

source /etc/bash_completion
JorisH
  • 428
  • 2
  • 8
  • 3
    Questions that are already answered elsewhere in the knowledgebase should be closed as duplicate so the already vetted/edited/voted-on answers can be used; answering them spreads out the moderation work (meaning folks need to vote on / edit / correct more copies of what should be the same answers). – Charles Duffy Nov 29 '19 at 16:03