ChinaUnix.net
相关文章推荐:

while read line

# 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 阅读(13676) 回复(35)

相关讨论

while read line 这句话是什么意思? line是系统的变量?

by wu_wei_jie - Shell - 2008-04-23 17:04:27 阅读(4031) 回复(3)

硬件: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 ...

by ccjsj1 - Shell - 2009-06-29 14:12:18 阅读(3795) 回复(5)

说明: 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

by cherishnana - Shell - 2009-05-22 12:11:12 阅读(1539) 回复(4)

我在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...

by lthz2000 - Shell - 2004-03-21 18:39:49 阅读(2723) 回复(5)

[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 问什么\ 没有了

by youcz - Shell - 2009-08-26 17:03:44 阅读(1429) 回复(2)

$cat file 1 2 3 $while read line;do echo “$line”;done

by 树上开花 - Shell - 2009-04-06 10:23:07 阅读(3292) 回复(4)

[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 编辑 ]

by meeslo - Shell - 2008-10-16 15:32:13 阅读(2389) 回复(4)

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出来呢?请大家给我讲讲,谢谢了.

by 灿烂小猪 - Shell - 2007-09-07 09:21:48 阅读(2118) 回复(4)

1 2 3 4 5 经过 while read line;do echo $line done 之后成了 1 2 3 4 5 希望保持原来的模样. 1 2 3 4 5

by w123456 - Shell - 2005-06-01 16:31:15 阅读(982) 回复(3)

cat ${tmpfile}|awk -F"|" '{print $2,$3,$4,$5,$6}'|while read host_desc check_time monitor_type monitor_item status 这里$2为空,这样的话就会把$3的值给变量check_time,请问有没有可以用分隔符隔开的啊,别让空格丢失啊

by princes1 - Shell - 2009-04-07 12:55:35 阅读(4425) 回复(9)