Re: [Fwd: Debugging execve problems]
Svante Signell, le Wed 04 Jan 2012 16:44:20 +0100, a écrit :
> #!/bin/sh
> IXBIN=/home/srs/DEBs/icon/debugging_icon/iconx
> IXLCL=`echo $0 | sed 's=[^/]*$=iconx='`
Ah, the executed thing is a shell script, not a binary. Ok, it's really
the same issue as Emilio was fixing some time ago, and reduces to this:
test.c:
int main(int argc, char *argv[]) {
char *t[] = {"test.sh", NULL};
execv("test.sh", t);
perror("execve");
return 0;
}
test.sh:
#!/bin/sh
echo I'm $0
test.sh gets /dev/fd/3, which is not helpful for the IXLCL computation
above.
Samuel
Reply to: