# -f 文件存在 if[ -f /etc/sysconfig/network ]; then ./etc/sysconfig/network fi # -z 字串为空/ -o or / -a and if[ -z "$HOSTNAME" -o "$HOSTNAME" = "(none)" ]; then HOSTNAME=localhost fi # ! if [ ! -e /proc/mounts ]; then mount -n -t pr…
1 shell 的$! ,$?, $$,$@ $n $1 the first parameter,$2 the second... $# The number of command-line parameters. $0 The name of current program. $? Last command or function's return value. $$ The program's PID. $! …
大家好!我是handsomecui,下面我为大家讲解一下shell脚本的写法,讲的不好的地方,欢迎大家留言拍砖. 1.在linux下会写shell脚本是非常重要的,下面我参照例子给大家展示几个脚本,顺带这学习shell 的语法: 什么时候helloworld是必不可少的,第一个脚本肯定与helloworld是离不开的: #!/bin/sh a="hello world!" num= echo "a is : $a num is : ${num}nd" 运行结果: a…
1. shell 的$! ,$?, $$,$@ $n $1 the first parameter,$2 the second... $# The number of command-line parameters. $0 The name of current program. $? Last command or function's return value. $$ The program's PID. $! …
http://blog.chinaunix.net/uid-7553302-id-183648.html 1 shell 的$! ,$?, $$,$@ $n $1 the first parameter,$2 the second... $# The number of command-line parameters. $0 The name of current program. $? Last command or function'…
变量的解构赋值 数组的解构赋值 对象的解构赋值 字符串的解构赋值 数值和布尔值的解构赋值 函数参数的解构赋值 圆括号问题 用途 数组的解构赋值 基本用法 ES6允许按照一定模式,从数组和对象中提取值,对变量进行赋值,这被称为解构(Destructuring). 以前,为变量赋值,只能直接指定值. var a = 1; var b = 2; var c = 3; ES6允许写成下面这样. var [a, b, c] = [1, 2, 3]; 上面代码表示,可以从数组中提取值,按照对应位置,对变量赋…
这几天,在看Unity3D,很有意思,其中看到,第一人称控制器,就想看到里面的一些控制脚本是如何实现,才发现,学到的好多数据知识已经还给老师了,还好,走遍大江南北,跟着的书不多,唯一的二本高数没丢. 然后参考网上各个简洁明了的讲洁. 主要有http://my.csdn.net/cppyin 的从零实现3D图像引擎. 用此文只是用来记录一些向量,矩阵等的操作.没别的实际意义.会与我的学习来更新此文章. 1.求矩阵的逆矩阵. type XMatrix3 = class val m11:float v…