Shell Programming2 *nix commands 급생각 난 shell-script들 적어둡니다. (부끄럽지만ㄱ-) bash가 주류 이며, 개선 및 지적 코멘트 환영합니다 :) reverse-dns가 지원되는 dns 서버에서 c-class 대역 도메인들 찾기. $ \ cnt=0; while [ $cnt -lt 256 ] ; do nslookup .$cnt | awk ' { print $$2 } ' | grep -v ^$ | grep -v find | sed 's/\.in-addr\.arpa.*name = /\./' | awk -F"." '{print $4"."$3"."$2"."$1"\t"$5"."$6"."$7"."$8}' | sed 's/com\./com/'; let "cnt++"; done 2012. 1. 12. Directory Tree #include #include #include #include #include #include void printdir(char *dir, int depth) { DIR *dp; struct dirent *entry; struct stat statbuf; if((dp=opendir(dir))==NULL) { fprintf(stderr,"cannot open directory: %s\n", dir); return ; } chdir(dir); while((entry=readdir(dp))!=NULL) { lstat(entry->d_name,&statbuf); if(S_ISDIR(statbuf.st_mode)) { if(strcmp(".",entry->d_name)==0 || strcmp("..",entry.. 2007. 9. 19. 이전 1 다음