>> Edit article
이름
제목
패스워드
출력할때 그냥 표준출력으로 보내지 않고 대신 more나 less로 보내려면 어떻게 바꿔야 하죠? 제가 펄맹(?)이라.. #!/bin/sh edic-perl $@ | less 이렇게 두줄짜리 스크립트를 하나 또 만들자니 좀 그렇고.. 제 경우 이걸 edic-perl 이란 파일로 저장한 후 .vimrc파일에 다음을 추가해 주었습니다. set keywordprg=edic-perl vi에서 영어단어 위에 커서를 갖다놓고 Shift+k를 눌러보세요. ^^ : shell script, python 이 나왔으니 perl도 빠질 수 없죠? ^^ : 제가 써오던 영어사전입니다. 그럼. : ---------------------------------------- : #!/usr/bin/perl : : use IO::Socket; : : if ($#ARGV < 0) { die "eng <word>" } : : $server = "kr.engdic.yahoo.com"; : $word = $ARGV[0]; : : $remote = IO::Socket::INET->new(Proto=>"tcp", PeerAddr=>$server, : PeerPort=>"80", Reuse=>1) : or die "Can't connect to "$server""; : # set buffering off : $remote->autoflush(1); : : $nl = chr(13).chr(10); : $end = chr(13).chr(10).chr(00)x4; : : $header = "GET /result.html?p=$word HTTP/1.1$nl"; : $header .= "Host: kr.engdic.yahoo.com$nl"; : $header .= "$end"; : : # write HTTP request to server : print $remote $header; : : # recieve everything the server sends, and print it to the screen : $i=0; : while ($line = <$remote>) { : if( $i < 83 ){ : $i++; : next; : } : if ($line =~ /^<br>$/){ last; } : $line =~ s/<(?:[^>'"]*|(['"]).*?1)*>//gs; # strip all html : tags. : print $line; : : } : close $remote;
Copyleft
1999-2026 by
JSBoard Open Project
Theme Designed by
IDOO
All right reserved