On Mon, May 21, 2001 at 12:42:39PM -0700, larry a price wrote:
>
>also what does the 
>
>. /etc/path/to/script
>
>idiom do, it doesn't seem to be documented in the place i expect it to be
>but i see it used in a number of scripts in /etc/postgresql
>
>can someone point me to a clear and lucid explanation of what's going on,
>i've read the man pages but they are rather opaque...and i'm still not
>getting what i expect from the beast.

In Bourne-derived shells, . is a shorthand for the "source" command, which
reads a file into the execution environment.  From the bash manpage:

      source filename [arguments]
              Read and execute commands from filename in the cur�
              rent  shell  environment and return the exit status
              of the last command  executed  from  filename.   If
              filename  does  not  contain a slash, file names in
              PATH are used  to  find  the  directory  containing
              filename.   The  file searched for in PATH need not
              be executable.  The current directory  is  searched
              if  no  file  is  found in PATH.  If the sourcepath
              option to the shopt builtin command is turned  off,
              the  PATH  is  not  searched.  If any arguments are
              supplied, they  become  the  positional  parameters
              when   filename   is   executed.    Otherwise   the
              positional parameters are  unchanged.   The  return
              status  is  the  status  of the last command exited
              within the script (0 if no commands are  executed),
              and  false  if  filename  is not found or cannot be
              read.

-- 
Christos anesti ek nekron
Thanato thanaton patisas;
Kai tis en tis mnimasi
Zoin charisamenos!

Reply via email to