亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区
Chinaunix
標題:
循環(huán)中,執(zhí)行命令超過3秒沒返回,循環(huán)繼續(xù)
[打印本頁]
作者:
shijiang1130
時間:
2014-10-24 20:23
標題:
循環(huán)中,執(zhí)行命令超過3秒沒返回,循環(huán)繼續(xù)
open my $fh,'<','host.txt' or die "not open";
while (my $host= readline $fh){
...
$result = `/bin/connect $host`; //這個命令執(zhí)行超過3秒沒返回,while循環(huán)繼續(xù)下一個元素
...
}
erlang來做
作者:
arserangel
時間:
2014-10-24 20:40
用 sys:cmd() ?
作者:
shijiang1130
時間:
2014-10-24 20:57
不用進程:
-module(timeout).
-compile(export_all).
r()->
{ok,S}=file:read_file("host.txt"),
%open my $fh,'<','host.txt' or die "not open";
H=binary:split(S,<<"\r\n">>,[global]),
to(H).
%while (my $host= readline $fh){
%...
to([])->
[];
to([H|T])->
timer:sleep(100),
Str ="/bin/connect "++ erlang:binary_to_list(H),
io:format("run string is~p~n",[Str]),
os:cmd(Str),
to(T).
%$result = `/bin/connect $host`; //這個命令執(zhí)行超過3秒沒返回,while循環(huán)繼續(xù)下一個元素
%...
%}
復制代碼
作者:
shijiang1130
時間:
2014-10-24 20:57
Eshell V6.2 (abort with ^G)
1> timeout:r().
run string is"/bin/connect 1.1.1.2"
run string is"/bin/connect 4.1.4.12"
[]
2>
復制代碼
歡迎光臨 Chinaunix (http://72891.cn/)
Powered by Discuz! X3.2