Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- jgor@ubuntu-lab:~$ cat name.c
- #include <stdio.h>
- int main() {
- char buf[32];
- printf("input your name:\n");
- scanf("%s", buf);
- printf("your name is %s\n", buf);
- return 0;
- }
- jgor@ubuntu-lab:~$ gcc -o name name.c
- jgor@ubuntu-lab:~$
- jgor@ubuntu-lab:~$
- jgor@ubuntu-lab:~$ ./name
- input your name:
- foo
- your name is foo
- jgor@ubuntu-lab:~$
- jgor@ubuntu-lab:~$
- jgor@ubuntu-lab:~$ echo foo | ./name
- input your name:
- your name is foo
- jgor@ubuntu-lab:~$
- jgor@ubuntu-lab:~$
- jgor@ubuntu-lab:~$ socat TCP-LISTEN:1337,fork,reuseaddr EXEC:"./name" &
- [1] 8877
- jgor@ubuntu-lab:~$ nc 127.0.0.1 1337
- foo
- input your name:
- your name is foo
- jgor@ubuntu-lab:~$
- jgor@ubuntu-lab:~$
- jgor@ubuntu-lab:~$ echo foo | nc 127.0.0.1 1337
- jgor@ubuntu-lab:~$
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement