in Linux "which source" returns nothing?

c, linux, shell, system-calls

Solution

It is a builtin shell command, like `cd`, `exit`, `pwd`...:

$ enable -p | grep source
enable source

Note that `enable -p` shows all the builtins. More info in enable Man page.

Update

Just saw a pretty interesting thread in SuperUser: What does source do?

$ type source
source is a shell builtin

Update 2 - comment by Tony D

@SIGSEGV: sometimes a command can be implemented as an external (non-shell) executable, but some shells will still want to provide their own implementation... possibly with different behaviour, possibly just to make it faster. test and pwd are examples of this. For example, the shell can get its current working directory using getcwd(), but if it runs a separate executable without changing the current directory for that executable, and the executable runs getcwd() - it still works.

Problem

I want to `source` some shell scripts in `c` using `exec()`. What is `source` ? is that a `binary executable` or a `shell script` ? where can i find that in linux file system ? I ran ``` charan@PC-113:~$ which source charan@PC-113:~$ ```

Original source