ChinaUnix.net
相关文章推荐:

shell grep 结果

grep "^$name" a.txt 将结果附给一个变量old,然后下面调用 sed 's/'$old'/XXX/' a.txt

by wb_1114 - Shell - 2006-11-20 15:56:25 阅读(4011) 回复(13)

相关讨论

本小菜鸟想在shell 中实现这样的功能 在a文件中如果含有“sucess”的字符,程序就继续进行,否则就打印错误,并推出 grep的查询结果怎么才能用到if中去呢? 或者有什么其他的方法可以实现 请各位大侠赐教!!

by happyradar - Shell - 2012-01-30 09:16:36 阅读(4618) 回复(6)

[work@w-m2 ~/software/hbase/conf]$ grep -n 'ratio' *.xml hbase-default.xml:2: hbase-default.xml:24: hbase-default.xml:125: operations such as fetching of the root region from root region hbase-default.xml:361: all updates across the duration of the compaction. hbase-default.xml:546: of operation. For a fully-distr...

by guocanwen - Shell - 2012-09-10 17:44:22 阅读(1584) 回复(5)

本帖最后由 luofeiyu_cu 于 2012-10-05 10:36 编辑 grep -l "mysed" /home/test 可以找出所有包含mysed的文章,假定有3个结果:/home/test/sed1,/home/test/sed2,/home/test/sed3 1.用firefox打开第2个结果 2.用firefox打开所有的结果 请问,如何用shell命令来完成?

by luofeiyu_cu - Shell - 2012-10-06 20:06:07 阅读(1082) 回复(2)

prtconf_grep memory的结果 : memory (driver not attached) virtual-memory (driver not attached) memory-controller, instance #0 memory-controller, instance #1 过去曾经看到应该是显示4096M,但为何现在显示的是这个?

by ppgpsj - Solaris - 2006-12-31 22:08:00 阅读(1256) 回复(4)

prtconf_grep memory的结果 :\r\n\r\n\r\n memory (driver not attached)\r\n virtual-memory (driver not attached)\r\n memory-controller, instance #0\r\n memory-controller, instance #1\r\n\r\n\r\n过去曾经看到应该是显示4096M,但为何现在显示的是这个?

by ppgpsj - Solaris - 2006-12-31 22:08:00 阅读(2835) 回复(3)

我执行了几个命令,但结果却不明白怎么回事,哪位大虾给指点指点啊?命令如下: $ grep u* t.txt ui u* lskdj` $ grep u t.txt ui u* $ grep * t.txt ls.tx:cat.out ls.txt:cat.out

by ohcyj - Shell - 2006-02-16 14:55:46 阅读(1026) 回复(1)

本帖最后由 prcardin 于 2015-04-30 10:01 编辑 grep得到的结果再处理 grep "dostr" $dir/*.txt action:dostr,m_uno:yx_hlld_93325534096,u_no:555523245,qd:yx.zhuanfa,plat:ANDROID,udno:d657c535-3avb-37bn-67ad-676689wer,server:10010,name_name:ither,ip:192.18.48.56 ,dostr_time:2014-10-01 01:54:24,name_exp:0987015,mi:100,currency:CNY,amount:1000,dostr_channel:HGFG,dono:5476_001_57788563424_894718199528...

by prcardin - Shell - 2015-04-26 18:17:29 阅读(4108) 回复(13)

本帖最后由 xiaoshichao143 于 2012-07-12 17:56 编辑 [code]printf 'a b\nc d\n\n\n\n\n\000\n\000e\000\000\nf' | grep -cz . printf 'a b\nc d\n\n\n\n\n\000\n\000e\000\000\nf' | grep -cz '$' printf 'a b\nc d\n\n\n\n\n\000\n\000e\000\000\nf' | grep -cz '^' printf 'a b\nc d\n\n\n\n\n\000\n\000e\000\000\nf' | grep -c '$'[/code]求指教

by xiaoshichao143 - Shell - 2012-07-13 17:32:32 阅读(1656) 回复(8)

for recode in `grep searchkey infile`;do echo $recode done 当检索结果过长的情况 比如,结果为abcd...................12345..... 会被切成2,3行 结果输出后 adcd............ 12345...... ..... 怎么才能不被切呢??

by linux_kim - Shell - 2011-07-11 20:46:29 阅读(3879) 回复(13)

[code]@a=qw(aa bb cc dd ee); push @a,"ff"; @b=qw(aa bb cc dd ee); push @b,"gg"; for(@b){ print grep /$_/,@a; print "\n"; }[/code] 怎么结果是: aabbccddeeff aabbccddeeff aabbccddeeff aabbccddeeff aabbccddeeff aabbccddeeff 的? 不是 aa bb cc dd ee 的吗? 怎么有这样的差别的? [ 本帖最后由 liang573728 于 2008-4-11 13:42 编辑 ]

by liang573728 - Perl - 2008-04-11 15:23:30 阅读(2549) 回复(6)