|      1jsonline      2014-05-16 00:35:05 +08:00 你干脆用 python 吧。普通开发者不要学 bash 了 | 
|  |      2ivvei      2014-05-16 00:42:46 +08:00 alias viewconfig="egrep -v '(#|^\s*$)' config|less" | 
|      5WDsUO7HnS2Na1DFC      2014-05-16 08:55:23 +08:00 #!/bin/bash egrep -v '(#|^\s*$)' $1 | less | 
|  |      6superbear      2014-05-16 09:00:05 +08:00 将变量作为参数传入就可以了,egrep -v xxx file.config | xargs less  试试 | 
|  |      7Sunyanzi      2014-05-16 09:21:21 +08:00 @ioiioi 直接用 alias 为何不行 ..?  以及如果只是想要空格翻页的话 ... 用 more 就好了 ... alias cfg="grep -Ev '(#|^\s*$)' $1|more" | 
|  |      8ioiioi OP | 
|  |      10ioiioi OP centos 6.5 [root@fzgw sites-enabled]# bash --version GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu) |