jp_hill
jp_hill

Reputation: 87

Want to understand what's going on with linux command

I am installing a virtualenv and want to understand what's going on.

$ curl -O https://raw.github.com/pypa/virtualenv/master/virtualenv.py - I understand curl fine

$ python virtualenv.py my_new_env - Understand this, too

$ . my_new_env/bin/activate - Here's where I get lost. What is the period doing here?

(my_new_env)$ pip install ... - What does it mean to have the parentheses here? Does this use tell me I'm in a folder?

Upvotes: 0

Views: 63

Answers (2)

VoteyDisciple
VoteyDisciple

Reputation: 37803

The dot is essentially an "execute" command — execute the commands in my_new_env/bin/activate as though they were typed into your prompt, essentially.

The parentheses shown in the prompt (at least in the tutorial instructions) then indicate that you're typing commands in your new virtual environment, and not in your original (real) environment.

Upvotes: 0

Ernest Friedman-Hill
Ernest Friedman-Hill

Reputation: 81694

The dot is a command that means to read and execute the contents of the given script in the current shell (normally running a shell script runs it in a new process.) Evaluating the script in the current shell can change the environment variables of the current shell, so the behavior of subsequent commands is affected.

I don't know for sure about the parentheses, but I don't think they're meant to be syntax you type. As they come before the '$' prompt, perhaps that's literally what you'll get as your new prompt after running the activate script, to show you that your environment has been changed?

Upvotes: 1

Related Questions