11℃
功能简介:
用法:
用方向键移动蛇即可。
有个Bug:一开始蛇不会出现,按任意方向键蛇就可以出现了。
注意:
不能回头。比如蛇往右移动时,则这时不能按往左的方向键。
测试环境:
[Bob]@[Fck_without_U]:[~]->uname -a
Linux bobtestmachine.net 2.6.18-194.el5 #1 SMP Tue Mar 16 21:52:39 EDT 2010 x86_64 x86_64 x86_64 GNU/Linux
[Bob]@[Fck_without_U]:[~]->echo $0
-bash
[Bob]@[Fck_without_U]:[~]->echo $SHELL
/bin/bash
[Bob]@[Fck_without_U]:[~]->bash --version ...
Game, Linux, Programme, Snake阅读全文
5℃
跨行匹配在sed里算不上是个难点,但绝对能考验一个人的sed基础……
这里就以《sed & awk》一书中的例子(高级sed命令章节)作为对象,或者直接参看CU的这篇帖子:http://bbs.chinaunix.net/thread-1685452-1-1.html,具体分析一下代码思路和执行过程,我也是大菜鸟,有不对的地方,还望各位指出……
首先明确一下几个概念:
b label
Branch to label; if label is omitted, branch to end of script.
h H Copy/append pattern space to hold space.
g G Copy/append hold space to pattern space.
D Del...
Linux, Programme, Sed, Unix阅读全文
4℃
8℃
最近在CU上总是看到有人问date的一些用法,这里就针对一些非常规的或者说比较特殊的用法做个小结(当然,一些基本的用法就不做介绍了,不懂的请直接man吧),Feel free to give your comments...
以下讨论的内容主要涉及到3个方面:
1. 数字域的填充用法
2. 相对日期的获得
3. 时间戳和日期的互相转换
1. 数字域的填充:
默认情况下,在显示日期和时间时,date命令使用数字0填充数字域。例如,如果用两位数字显示月份,则6月显示为“06”,如下所示:
$ date +%m
06
当然,一切皆有变通,你可以用下述控制符...
Command, Date, Linux, Programme阅读全文
6℃
用英文用的太久了,这次就用中文了,
首先,此篇文章是由CU Shell版的一篇帖子引申出来的,有兴趣的可以点击一下链接查看:
http://bbs.chinaunix.net/thread-2287787-1-2.html
其次,网中人前辈我就不介绍了,我想混过CU Shell版或者看过《13问》的人应该都很清楚,想了解更多,请点击网中人维护的站点:http://www.study-area.org/menu1.htm
本文很简单,只是一个小例子,但是还是需要说明几点:
第一,写程序或者写脚本,功底固然重要,但更重要的,是思想,这是我一贯所坚持的!
第二,关于tr的用法,这里...
Linux, Programme, tr阅读全文
5℃
Today I want share with you various ways(what I can call to mind are at least 10 ways) to combine two lines to one line...Those ways are used by awk, sed, xargs, paste, etc...
Pls feel free to give your comments and welcome to point out if I missed something or I got something wrong...Thanks...
Following is an original file named urfile(notes that there're blank spaces at the beginning of even lines):
[12:37:20-Bob@hzling20:~/test]-(1083)No.83->$ cat urfile
AA
...
Awk, Combine, Linux, paste, Programme, Sed, xargs阅读全文
2℃
There're at least 4 ways to compare two strings by ignoring cases, and at least 5 ways to calculate the length of string, here I list those 4 and 5 ways, welcome feel free to comment your ideas.
I: Case insensitive when comparing two strings:
1). If you're using bash, then following is a absolutely a good way, open the option "nocasematch":
str1="MATCH"
str2="match"
shopt -s nocasematch
case "$str1" in
$str2) echo "match";;
*) echo "no match";;
esac
2). Another good ...
Awk, grep, Linux, Programme, Strings, tr阅读全文
1℃
----------------------
Reproduced statement:
This post is reprinted/referred/quoted from the following link, good article:
http://www.go2linux.org/rename-bulk-files-with-linux-console-command
-------------------------------------------------------------------------
Important notes:
All examples of this article are tested successfully in Ubuntu/Debian environment.
And I have tested these examples also in RHEL/Non-Debian environment, but failed.
So, pls note about this.
--...
Command, Linux, mv, Programme, Rename阅读全文












谢谢分享
赶紧学习一下,谢谢!
谢谢 希望能下
好東西! 下來試一下。
谢谢你,我的问题已经解决了,
评论啊,你太伟大了
感谢分享,不知道现在还能下载
谢谢博主分享!