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:~$
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.
Just saw a pretty interesting thread in SuperUser: What does source do?
$ type source
source is a shell builtin
@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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With