#!/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
shell bash 是linux系统最常用的脚本,在其里面可以写上grep sed awk等常用命令用到grep那么就要想到正则开头是小写字母的那一行就列出grep -n '^[a-z]'oo前不能是小写字母grep -n '[^a-z]oo'不想要开头是英文字母grep -n '^[^a-zA-...
分类:
其他好文 时间:
2014-07-16 20:23:02
阅读次数:
163
two ways here I provide:+ use openSSH command line on git bash(such as msysgit bash) + ls -al ~/.ssh + ssh-keygen -t rsa -C "phpgcs@qq.com" + e...
关于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
使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