Setting the LD_PRELOAD environment variable for commands is done without entering the full path

I play with LD_PRELOAD and created a library that simply transfers puts () to a function that converts the print string to uppercase before printing. Then I export the LD_PRELOAD variable this way

$ export LD_PRELOAD=/home/adrian/test/myputs.so

Now the behavior works as expected when running the command

$ /bin/pwd
/HOME/ADRIAN/TEST

But when doing this

this does not work.
$ pwd
/home/adrian/test

What is the mechanism that ignores the LD_PRELOAD environment variable in this case?

+3
source share
1 answer

Because there pwdis shell builtin command- see man bashor docs here . Therefore, if you write

$ pwd

. , ELF LD_PRELOAD.

+3

All Articles