Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: /usr/bin/script annoyance



In message <19980916114138.A23822@xxxxxxxxxxxx>, Dan Nelson writes:
>The prototype for the execve syscall is usually
>
>execve(const char *path, char *const argv[], char *const envp[])
>
>and the string that determines sh compatibility mode for zsh is not
>'path', but 'argv[0]'.  If you were to run script under dbx and break
>on the execve call, I'd bet anything that the contents of the string at
>0xEFFFF918 is "sh".

That would make sense, lucky me. :)

>Zefram's solution to this problem is the shortest:
>
>> Alternatively, set your SHELL to be the executable of this program:
>>
>>        extern char **environ;
>>        int main(int argc, char **argv)
>>        {
>>            if(argc != 0)
>>                argv[0] = "zsh";
>>            execve("/usr/local/bin/zsh", argv, environ);
>>            _exit(1);
>>        }
>
>That'll guarantee that zsh gets called as "zsh".

I did this, and thankfully, it worked.  Really screwed up way to do it,
but it works. :)  Thanks for the help, it was greatly appreciated.

Of course, this brings up one more question... is this something that
can be fixed eventually in zsh?


Ken Lareau
elessar@xxxxxxxxxxx



Messages sorted by: Reverse Date, Date, Thread, Author