免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
楼主: lightspeed
打印 上一主题 下一主题

[学习共享] [ SHELL 综合水平测试 ] [复制链接]

论坛徽章:
0
1 [报告]
发表于 2005-04-29 11:39 |显示全部楼层

[ SHELL 综合水平测试 ]

原帖由 "bst"]123 shell 发表:
# type -all ls
ls is aliased to `ls --color=tty' (alias)
ls is a function             (function)
ls ()                     
{                          
    ls --color=tty -a
}
ls is ..........


# type test
test is a shell builtin

# function test () {
> sleep 3
> }

# type -all test
test is a function
test ()
{
    sleep 3
}
test is a shell builtin

# test
(here wait 3 seconds)

so alias, function, build-in command , external comand is right

论坛徽章:
0
2 [报告]
发表于 2005-04-29 11:52 |显示全部楼层

[ SHELL 综合水平测试 ]

原帖由 "寂寞烈火" 发表:

再看看!
就是相当于grep的-i的功能吧!


awk 'BEGIN {IGNORECASE=1} /abc/ {print $0}'  filename

awk '$0 ~ /[Aa][Bb][Cc]/ {print $0}' c

论坛徽章:
0
3 [报告]
发表于 2005-04-29 12:05 |显示全部楼层

[ SHELL 综合水平测试 ]

7. 将数据文件中的每个词的第一个字母变成大写. (难度: 2 - 4)

awk '{first=substr($0,1,1); sub(/^./,toupper(first),$0); print $0}' yourfile
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP