#!/bin/bash#提示用户输入echo -n "Please enter number"read n #读入输入的值放到变量n中sd=0rev=""on=$n #将变量n的值保存到变量on中,方便以后用到echo "You put number is $n"while [$n -gt 0]do...
分类:
其他好文 时间:
2014-07-16 23:03:53
阅读次数:
261
#!/bin/bash #判断命令行是否代带有两个文件名的参数 if [ "$1" = "" ] || [ "$2" = "" ] then echo "Please enter file name" exit 1 fi #判断目标文件是否存在 if [ -e $2 ] then echo "...
分类:
其他好文 时间:
2014-07-16 22:59:29
阅读次数:
153
$ echo $((20.0/7))$ zcalc$ bc <<< 20+5/2$ bc <<< 'scale=4;20+5/2'$ expr 20 + 5$ calc 2 + 4$ node -pe 20+5/2 # Uses the power of JavaScript, e.g. : no....
分类:
其他好文 时间:
2014-07-16 22:53:27
阅读次数:
184
关于redis是什么就不介绍了,安装过程参考了:http://www.cnblogs.com/silent2012/p/3499654.html。#!/bin/bash#定义安装目录export REDIS_HOME=/home/test/redis#创建安装目录mkdir $REDIS_HOME#...
分类:
系统相关 时间:
2014-07-12 13:30:20
阅读次数:
315
Implement wildcard pattern matching with support for '?' and '*'.
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).
The matching should cover t...
分类:
其他好文 时间:
2014-07-10 21:21:42
阅读次数:
255
使profile生效的方法1.source/etc/profile使用.bash_profile生效的方法1..bash_profile2source.bash_profile3execbash--login
分类:
系统相关 时间:
2014-07-10 19:19:08
阅读次数:
214
Shell编程学习之二一、bash的条件测试测试方法或者说测试书写:testEXPR[EXPR][[EXPR]]例如:测试变量User_Name的之是否为roottest$User_Name="root"[$User_Name=="root"][[$User_Name=="root"]根据比较时操作数的类型,测试类型分为:测试类型运算符运算符所代表的意义示例整..
分类:
系统相关 时间:
2014-07-10 18:36:31
阅读次数:
303
bash的配置文件分为两类全局配置/etc/profile/etc/profile.d/*.sh/etc/bashrc个人配置~/.bash_profile~/.bashrcprofile类的配置:设定环境变量;运行命令或脚本bashrc类的配置:设定本地变量;定义命令别名登录式shell如何读取配置文件(通过本地命令行或远程终端登录;su-usern..
分类:
其他好文 时间:
2014-07-10 17:59:21
阅读次数:
243
先在Mac OS的终端查询下本机是否已安装LuaLast login: Thu Jul 10 07:54:48 on ttys000keshans-Mac-mini:~ keshan$ lua-bash: lua: command not found 2. 如果没有(如上)的话去Lua的官方网站下....
分类:
其他好文 时间:
2014-07-10 15:50:08
阅读次数:
173
1、 如果select的结果为空,则实际上什么也不做 2、xpath中的通配符 通配符 描述 * 匹配任何元素节点。 @* 匹配任何属性节点。 node() 匹配任何类型的节点。 3、 如上代码演示了如何在输出文档流中插入变量、参数值,方法为{$名称} 4、call-template和apply-t...
分类:
其他好文 时间:
2014-07-10 15:34:55
阅读次数:
175