求一简单shell脚本

wangjun88019014 2009-11-10 07:29:27
现在有一个文件,如data.log
文件的内容很简单,里面一行一行的手机号码
13421608969
15115088495
13975033071
15241343379
15174246406
13751683822
。。。。。
。。。。。

在当前目录有msg文件夹,里面是对于手机号码的目录,如
drwxr-xr-x 2 root root 4096 Nov 10 17:33 20090922-093325-891-211.138.237.200-15273033529/
drwxr-xr-x 2 root root 8192 Nov 10 17:32 20090922-100437-924-211.138.237.200-15973049112/
drwxr-xr-x 2 root root 4096 Nov 10 17:32 20090922-104226-349-211.138.237.200-15273033531/

现在我想根据上面的data.log文件删除对应的目录。注意前面有日期,过滤掉,用"*手机号"
`hile read line
do
....
done < data.log
...全文
107 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
wangjun88019014 2009-12-30
  • 打赏
  • 举报
回复
http://www.ibm.com/developerworks/cn/webservices/ws-sqzsoap/
wangjun88019014 2009-12-25
  • 打赏
  • 举报
回复
URL url = new URL(wappush_rul);
HttpURLConnection conn = (HttpURLConnection) url.openConnection();

conn.setRequestMethod("POST");
conn.setRequestProperty("Content-Type",WAPPUSH_CONTENT_TYPE);
conn.setRequestProperty("Content-Length",requestData.length + "");
conn.setDoInput(true);
conn.setDoOutput(true);

// JDK1.4的设置超时时间
// System.setProperty("sun.net.client.defaultConnectTimeout", "30000");
// System.setProperty("sun.net.client.defaultReadTimeout", "30000");

OutputStream os = conn.getOutputStream();
os.write(requestData);
os.flush();
os.close();

InputStream is = conn.getInputStream();
wangjun88019014 2009-12-25
  • 打赏
  • 举报
回复
IBindingFactory bfact = null;
IUnmarshallingContext uctx = null;
Object obj =null;

bfact = BindingDirectory.getFactory(jibxclass);

uctx = bfact.createUnmarshallingContext();

return obj = uctx.unmarshalDocument(in, "UTF-8");
baihuihui 2009-11-13
  • 打赏
  • 举报
回复
cat data.log|while read line
do
cd msg/
find . -type d -name "$line"|xargs rm -rf
done
赵4老师 2009-11-11
  • 打赏
  • 举报
回复
for /f %a in (data.log) do (for /d %d in (msg\*%a.) do rd /s /q %d)
wangjun88019014 2009-11-10
  • 打赏
  • 举报
回复
没人....

无语....

3,423

社区成员

发帖
与我相关
我的任务
社区描述
其他开发语言 其他开发语言
社区管理员
  • 其他开发语言社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧