[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
[an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]![]() |
![]() |
![]() |
|||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
![]() |
![]() |
![]() |
Jeppe Larsen <sslug@sslug> writes: >> Jeg kan ikke lige se hvordan det skule kunne lade sig gøre. > > Så forstår man bedre hvorfor han kan love en kasse øl ;) Men det kan da > være det netop er pointen at man ikke kan, da vi netop har haft om > processer. Med mindre man altså snyder: #include <stdio.h> #include <stdlib.h> #include <unistd.h> int main(int argc, char *argv[]) { if(argc != 2) { printf("Usage is: chdir <directory>\n"); exit(1); } printf("Trying to change directory to %s\n", argv[1]); int r = chdir(argv[1]); if(r != 0) { printf("An error has occured\n"); exit(1); } printf("Directory succesfulled changed to %s\n", getcwd(NULL,0)); char *shell = getenv("SHELL"); if (execlp(shell,shell,NULL) != 0) { perror("Couldn't exec $SHELL"); exit(1); } exit(0); } -- Peter Makholm | I laugh in the face of danger. Then I hide until sslug@sslug | it goes away http://hacking.dk | -- Xander
![]() |
![]() |
![]() |
||||||||||||
|
||||||||||||||
![]() | ||||||||||||||
|
||||||||||||||
![]() |
![]() |
![]() |