# cat ipcitytable 类似下面这样 367656960 367722495 台北 798588928 798605311 北京 798621696 798687231 北京 973996032 974127103 济南 974127104 974180351 贵阳 974180352 974182399 六盘水 974182400 974192639 贵阳 974192640 974198527 南昌 974198548 974200319 南昌 974200320 974200831 九江 ## cat ip.txt 367656961 798621697 类似这样 现在想要实现...
by xuledw - Shell - 2009-11-07 17:45:15 阅读(13698) 回复(35)
现有一个脚本test.sh: while read line do ./testa.sh $line & done < $1 脚本testa.sh ..... ---执行一些命令 if [ `...` = "11" ] ; then ---满足某些条件 rexec testserver2 -l test "cd /tmp; touch 11" fi 在crontab下执行脚本test.sh file -- file为脚本test.sh的参数$1 发现当满足条件,执行到rexec testserver2 -l test "cd /tmp; touch 11" 语句时,read line语句将不会往下读file文件,不知是什么原因?
硬件:Pentium D CPU 3.00GHz 软件:redhat as4u4 系统 1.为什末t3.sh的执行结果中没有127.0.0.1呢,使被awk过滤没了?(hosts,t1.sh,t2.sh,t3.sh在相同目录下) 2.t3.sh中 ADDR=`awk '{print $1}'`的awk的是针对那个文件过滤得呢? ########################### hosts内容 cat hosts # Do not remove the following line, or various programs # that require network functionality will fail. 127.0.0.1 ...
说明:
tv_chaged 里面的文件格式如下
223212451 12
255456666 14
854566456 7
……
想把第一列的值赋给md 第二列的赋给tv 然后以tv做为参数执行./other.sh脚本
但是总是执行完一行,就有一个很奇怪的值赋给$line了,导致不能正常执行完循环~~请各位大侠帮忙看看
脚本如下:
#!/bin/bash
while read line
do
echo $line
md=`echo $line|awk '{printf $1}'`
tv=`echo $line|awk '{printf $2}'`
./other.sh $tv
done
我在TMP目录下有很多文件,我想做一个脚本,MORE这些文件,然后拿到相应的参数,写了下面一个脚本 注:LIST是我手工生成的TMP目录下的这些文件列表。 while read line do #echo $line; sleep 5 hostname=`echo $line |awk '{ print $1 }'` interface=`echo $line |awk '{ print $2 }'` ipadd=`echo $line |awk '{ print $3 }'` desip=`echo $line |awk '{ print $4 }'` expect ping.exp $hostname $interface $ipadd desip...
[root@you-env-6 youcz]# while read line;do echo "xx $line" | tee test.txt ;done < cc xx aaaa bb xx bbbb cc xx [root@you-env-6 youcz]# cat cc aaaa \bb bbbb \cc 问什么\ 没有了
$cat file
1
2
3
$while read line;do echo “$line”;done
[code] ]# echo aa\ aa |sed 's/./&\n/g'|sed '$d'|sed 's#\\#\\\\#'|while read "line" ;do echo "$line" ; done|cat -e a$ a$ $ a$ a$ ]# echo aa\ aa |sed 's/./&\n/g'|sed '$d'|sed 's#\\#\\\\#'|cat -e a$ a$ $ ########有空格. a$ a$ [/code] 为什么空格会没有掉? 怎么保留空格? [ 本帖最后由 meeslo 于 2008-10-16 13:35 编辑 ]
open (F1,"data.txt") or die("read data.txt error"); #-----5 open (F2,"datb.txt") or die("read data.txt error");#------------6
logoffs文本文件内容如下: Logged off at Wed Sep 5 00:31:43 CST 2007 Logged off at Wed Sep 5 00:35:36 CST 2007 Logged off at Wed Sep 5 00:44:53 CST 2007 read1脚本内容如下: #!/bin/bash while read line do echo "$line" done 为什么我使用./read1 logoffs,没有echo出来呢?请大家给我讲讲,谢谢了.