0

In the ESP32 documentation, I found this line:

. $HOME/esp/esp-idf/export.sh

What does the command . ./script.sh mean in bash ?

4
  • Related: unix.stackexchange.com/q/309768/589116 Commented Jun 8 at 9:19
  • doesn't the question you're linking to explain exactly that? Commented Jun 8 at 12:36
  • it links to unix.stackexchange.com/questions/43882/… which really gives very nice explantions! Commented Jun 8 at 12:37
  • @MarcusMüller I found it only after the question was answered. We can flag this question as a duplicate. Commented Jun 8 at 13:26

1 Answer 1

3

It is a shortcut for source ./script.sh. This command tells the shell to execute the contents of script.sh within the current shell session, rather than launching a new subprocess.

Sometimes, scripts define environment variables that need to persist in the current terminal session. To ensure these variables remain available, the script must be executed in the same shell environment.

See also:

1

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.