?? l-out.c
字號:
/*l-out.c simple pipe .c , you can ripper it if you need. compile with gcc l-out.c -o l-out usage : bash-2.05a$ ./ciao "nmap localhost" lupo bash-2.05a$ cat lupo Starting nmap V. 3.00 ( www.insecure.org/nmap/ ) Interesting ports on localhost (127.0.0.1): (The 1595 ports scanned but not shown below are in state: closed) Port State Service 21/tcp open ftp 23/tcp open telnet 25/tcp open smtp 587/tcp open submission 6000/tcp open X11 6699/tcp open napster Nmap run completed -- 1 IP address (1 host up) scanned in 1 second bash-2.05a$*/ #include <stdio.h>#include <stdlib.h>#include <string.h>#include <unistd.h>void usage(){ fprintf (stdout,"l-out.c [command] [filelog]\n"); exit(0);}int main( int argc, char** argv ){ FILE* f; FILE* record; char *recordstring; char *command; if (argc<3) usage(); command=argv[1]; if ( ( record = fopen(argv[2],"wb")) == NULL ) { perror("fopen" ); exit (0); } if( ( f = popen( buffer, "r" ) ) == NULL ) { perror( "popen" ); return EXIT_FAILURE; } while(!feof(f)) { recordstring=malloc(sizeof(recordstring)); fgets(recordstring,sizeof(recordstring),f); fprintf (record,"%s",recordstring); } fclose(record); pclose( f ); return EXIT_SUCCESS; }
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -