Chinaunix首页 | 论坛 | 博客
  • 博客访问: 273583
  • 博文数量: 76
  • 博客积分: 1414
  • 博客等级: 中尉
  • 技术积分: 702
  • 用 户 组: 普通用户
  • 注册时间: 2011-12-14 21:05
文章分类

全部博文(76)

文章存档

2013年(8)

2012年(68)

我的朋友

分类: LINUX

2012-04-07 00:39:56

output_file=googlehost.txt
cat /root/a.txt | while read address host_name
do
 if [[ $address =~ '^#' ]];then
  echo $address >> $output_file
 elif [[ $address =~ '^$' ]];then
  echo "" >> $output_file
 else
  echo 72.14.203.132 $host_name >> $output_file
 fi
done

阅读(753) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~