Skip to content

Instantly share code, notes, and snippets.

@prodeveloper0
Created April 16, 2016 06:57
Show Gist options
  • Select an option

  • Save prodeveloper0/dd506163dc7834f55e7930144d9cea76 to your computer and use it in GitHub Desktop.

Select an option

Save prodeveloper0/dd506163dc7834f55e7930144d9cea76 to your computer and use it in GitHub Desktop.
Windows는 OpenSSH for Windows 설치가 필요.
#include <stdio.h>
#ifdef WIN32
#define popen _popen
#define pclose _pclose
#endif
FILE *stream = popen("ssh pr0ximo@192.168.2.144 cat /home/pr0ximo/2008.csv", "r");
int main(int argc, char **argv)
{
if(stream)
{
char buf[512] = {0,};
while(fgets(buf, 511, stream))
printf("%s", buf);
pclose(stream);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment