ChinaUnix.net
相关文章推荐:

shell read命令

shell脚本的read命令问题 #cat alarm.txt %a dsafa %A %a adsfjaljdfla %A #cat alarm.txt|grep "%A"|wc -l| read alarmNo #echo #{alarmNo} 为什么没有显示出来"2"? 急,在线等 必须使用命令行将"%A"的个数读入变量中。

by kenail2002 - Shell - 2005-09-10 20:25:28 阅读(4298) 回复(6)

相关讨论

read命令 功能: 从键盘输入内容赋给变量 格式: read [选项] [变量1] [变量2] [变量n] 选项: -p 提示输入内容 -t 等待输入内容秒数 本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/44606/showart_1385597.html

by 3120167 - Linux文档专区 - 2008-11-07 02:23:43 阅读(676) 回复(0)

根据以下命令来判断WAS是否在运行状态,最后一行表明该服务是STARTED,我想要取到最后一行,请大家帮忙 [root@was root]# /opt/WebSphere/AppServer/bin/serverStatus.sh server1 ADMU0116I: 在文件 /opt/WebSphere/AppServer/logs/server1/serverStatus.log 中记录工具信息 ADMU0500I: 检索 server1 的服务状态 ADMU0508I: Application Server" server1" 是 STARTED /opt/WebSphere/AppServe...

by 163hbfang - Linux环境编程 - 2007-05-24 18:56:41 阅读(3518) 回复(3)

read命令有没有什么参数可以使交互文字带颜色,我实在看不懂man手册

by 紫暝 - Linux新手园地 - 2010-08-14 19:16:13 阅读(1375) 回复(2)

read命令的两个参数-p 和-s如果顺序对调,就无法正常执行,为什么???

by troywin - Shell - 2009-09-24 23:22:14 阅读(3070) 回复(3)

可以使用r e a d语句从键盘或文件的某一行文本中读入信息,并将其赋给一个变量。如果只 指定了一个变量,那么r e a d将会把所有的输入赋给该变量,直至遇到第一个文件结束符或回 车。 它的一般形式为: read varible1 varible2 ... 在下面的例子中,只指定了一个变量,它将被赋予直至回车之前的所有内容: [root@localhost sgy]#read name shang [root@localhost sgy]#echo $name shang 如果输入文本域过长, shell 将所有的超长部...

by shangguanyun - Linux文档专区 - 2006-03-19 21:07:39 阅读(788) 回复(0)

想问一下read命令的-t选项怎么用,还有read命令怎么读入换行符啊,用反斜杠也不行,谢了。

by ILoveMK - Shell - 2009-06-26 20:22:21 阅读(1316) 回复(5)

本人SUN的服务器,SOLARIS 9系统,在shell中想用read命令从一个文本文件(/lianxi/abc)中读取其中的所有行,并将每行的3个文本段本别显示出来,但是我的程序只能循环显示第一行,为什么??因为read命令每次只能从文本中读取第一行,而无法自动读取下一行??附上我自己编的程序: while read c < /lianxi/abc do set $c echo "$1" echo "$2" echo "$3" done 后来我把程序改成: while read c < /lianxi/abc do set $c echo "$1...

by lkwsxdz - Shell - 2008-05-04 09:55:18 阅读(3715) 回复(9)

这是在"man bash"中的一段 [code]read [-ers] [-u fd] [-t timeout] [-a aname] [-p prompt] [-n nchars] [-d delim] [name ...] One line is read from the standard input, or from the file descriptor fd supplied as an argument to the -u option, and the first word is assigned to the first name, the second word to the second name, and so on, with leftover words and their intervening separators ...

by r2007 - Shell - 2007-12-03 13:16:32 阅读(16425) 回复(21)

有些shell下,运行read命令后,用户可以使用回退键(BackSpace)删除错误输入的字符,如sh 而有些shell下,运行read命令,就不能使用回退键,bash好象就不行。 这个问题该如何解决啊?

by wabc - Shell - 2003-05-14 16:47:24 阅读(1110) 回复(4)

本帖最后由 wuxiaobo_2009 于 2013-12-08 13:56 编辑 见2楼

by wuxiaobo_2009 - Shell - 2013-12-08 19:20:48 阅读(1919) 回复(4)