LINENO
当前在执行的脚本或者shell函数的行号。
LINES
命令select用来确定打印选择列表的列宽。收到SIGWINCH后,自动设置。
MACHTYPE
是一个字符串,描述了正在运行Bash的系统的类型,描述的格式符合GNU cpu-company-system 标准。
...
分类:
其他好文 时间:
2014-06-25 19:24:15
阅读次数:
220
碰到一个shell中函数调用的小问题,记录一下。
shell中函数有三种调用方式,一种是在文件前面定义函数,然后在下面直接调用;一种是通过载入shell,在shell中直接调用;第三种是将函数写入文件,然后在其他shell中调用函数。
这里写一下关于第三种方法的例子:
is_it_a_directory()
{
if [ $# -lt 1 ];then
echo "is_it_a_dir...
分类:
其他好文 时间:
2014-06-24 20:17:56
阅读次数:
195
#!/bin/bashfunction myfun(){ echo "echo result"
return 0}returnValue=$(myfun)echo "${returnValue}"这里returnValue得到的并不是0,而是"echo
result",想要得到funct...
分类:
其他好文 时间:
2014-06-02 17:19:17
阅读次数:
190
编写一个shell脚本,实现加法和乘法运算。#!/bin/bash#Function:num1+num2num3*num4sum(){read-p"pleasekeyinfirstnumber:"num1read-p"pleasekeyinsecondnumber:"num2letnum3=${num1}+${num2}echo-e"\033[32m$num1+$num2=$num3\033[0m"}#############cf(){read-p"pleasekeyinfi..
分类:
其他好文 时间:
2014-05-27 03:28:19
阅读次数:
219
#!/bin/bash# 用shell中的数组构造统计不同的组合个数.#
下面的组合有(1,6)(3,4)(5,5)(1,6)(5,5)(4,3)(1,8)#
不同的组合为(1,6)(3,4)(5,5)(4,3)(1,8)arrayLeft=(1 3 5 1 5 4 1)arrayRight=(6 ...
分类:
其他好文 时间:
2014-05-26 19:17:19
阅读次数:
409
转载:http://www.cnblogs.com/chengmo/archive/2010/09/30/1839632.htmllinux
shell在编程方面比windows 批处理强大太多,无论是在循环、运算。已经数据类型方面都是不能比较的。
下面是个人在使用时候,对它在数组方面一些操作进行的...
分类:
系统相关 时间:
2014-05-26 09:17:42
阅读次数:
446
VC获取指定文件夹路径flyfish 2010-3-5一 使用Shell函数1
获取应用程序的安装路径TCHAR
buf[_MAX_PATH];SHGetSpecialFolderPath(NULL,buf,CSIDL_PROGRAM_FILES,NULL);AfxMessageBox(buf);2...
分类:
其他好文 时间:
2014-05-01 10:42:38
阅读次数:
357