0

I have snippet from a shell script. Wondering what does the line starting with a 'dot' mean? It doesn't work when I try on Mac

test -x $DAEMON || exit 0

set -e

. /lib/lsb/init-functions
Mureinik
  • 297,002
  • 52
  • 306
  • 350
  • 2
    Possible duplicate of [unix command line execute with . (dot) vs. without](https://stackoverflow.com/questions/922651/unix-command-line-execute-with-dot-vs-without) – nullPointer Feb 20 '19 at 08:19
  • The dot command should definitely work on a Mac, too; but you probably don't have a file named `/lib/lsb/init-functions`, which is a feature of the Linux Standard Base (Linux is a different operating system than MacOS). – tripleee Aug 29 '22 at 11:19

1 Answers1

3

. is a shorthand for the source command in bash and similar shells. It will execute the contents of the script passed to it as a parameter (/lib/lsb/init-functions in this case) in the current context.

Mureinik
  • 297,002
  • 52
  • 306
  • 350