Created
November 14, 2020 09:15
-
-
Save ephemient/61e6c25bd938ad3fd1f44d8fe597bcb4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <fcntl.h> | |
#include <stdlib.h> | |
#include <unistd.h> | |
int main() { | |
int pipefd[2]; | |
close(0); | |
close(1); | |
pipe(pipefd); | |
write(1, "echo $Q\n", 8); | |
execle("/bin/sh", "sh", NULL, (char *[]) {"Q=echo $Q", NULL}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment