Skip to content

Instantly share code, notes, and snippets.

@WangYihang
Created November 23, 2017 10:24
Show Gist options
  • Save WangYihang/dcc51571d5fdb71a106bc7cc0389742f to your computer and use it in GitHub Desktop.
Save WangYihang/dcc51571d5fdb71a106bc7cc0389742f to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <unistd.h>
int main(int argc, char* argv[])
{
FILE * fp;
char buffer[0x100];
fp=popen(argv[1],"r");
int counter = 1;
while(counter){
counter = fread(buffer, 1, sizeof(buffer), fp);
write(1, buffer, counter);
}
pclose(fp);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment