I have this bash script:
#!/bin/sh -eux . ./.env
What does the second line do?
It seems to be impossible to google such syntax :)
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
Regarding the dot:
. (source or dot operator)
Read and execute commands from the filename argument in the current shell context.
Syntax . filename [arguments]
source filename [arguments]
source is a synonym for dot/period '.' in bash, but not in POSIX sh, so for maximum compatibility use the period.
That is a hidden file (starts with a dot) called
.env in the current directory (
Basically this command sources the file
.env and from the filename you can assume it reloads environment variables. It is equivalent to