vmonteco
vmonteco

Reputation: 15443

"which" command gives me the source code and not the path of a command

I'm working with some python virtualenvs, and I was wondering how the workon command was made.

So I made a which workon to get the path of workon. I had directly the whole source code of workon --- so I got an answer to my question --- but I expected a path.

What does it mean? Isn't workon contained in a file?

Upvotes: 1

Views: 50

Answers (1)

robertklep
robertklep

Reputation: 203504

workon is a shell function (see here), not a separate script.

I'm not sure if every shell will show you the function source when you run which, but at least the zsh does.

Upvotes: 2

Related Questions