If the shell thinks it is a "login shell" then it will source .profile before processing regular commands. Usually this test is just that argv[0] begins with a dash `-'. Try linking sh to -sh, for example, then invoking -sh.