操作系统:win7
虚拟机:Virtual box with Ubuntu13.10
WEB服务器: Nginx
WEB服务器发布目录:/usr/local/nginx/html/c
测试文件:list.txt
步骤:
1.新建一个shell脚本文件auto_html.sh.编辑内容如下:
#!/bin/bash
# created by bing
HTML=index.html
cat >$HTML <
EOF IP=`echo $line |awk '{print $2}'` echo " done < list.txt #测试文件 cat >>$HTML <
ID IP address DNS Name
while read line
do
ID=`echo $line|awk '{print $1}'`
NAME=`echo $line |awk '{print $3}'` " >>$HTML
$ID $IP $NAME