一:单行注释直接在行首加"#"如:#我是注释行二、多行注释利用:空命令注意:以下方法中如果在注释中出现反引号引用的命令将会执行,存在风险。1.把输入重定义到前面的命令,但是":"是空命令,所以就相当于注释了。:<<BLOCK
....我是注释内容
....我是注释内容
....我是命..
分类:
其他好文 时间:
2014-07-30 17:50:34
阅读次数:
242
#!/bin/bash#文件名:checkword.shword=$1grep "^$1$" /usr/share/dict/linux.words -qif [ $? -eq 0 ];then echo $word is a dictionary word;else e...
分类:
其他好文 时间:
2014-07-30 17:10:13
阅读次数:
180
1、将来aapt和apktool拷贝到/usr/bin/下面 2、运行aapt报错: -bash: /usr/bin/aapt: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory 解决:反查需要的文件在哪个包中 yum whatprovides *...
分类:
系统相关 时间:
2014-07-30 15:07:05
阅读次数:
583
首先介绍bash的特殊语法${parameter#*word}其中parameter为变量,word为分隔符,表示从变量最边左字符开始到第一匹配到分隔符(word)之间的字符串都去掉${parameter##*word}:表示从变量最左边字符开始到最后一次匹配到该分隔符之间的字符串都去掉注意:其中变量不要加$符号当*..
分类:
系统相关 时间:
2014-07-30 03:25:33
阅读次数:
306
1.找到android sdk的本地路径,adb命令在platform-tool下面,记为XXXX我的路径是(/Applications/eclipse/android-sdk-mac_x86/platform-tools)2.打开终端输入touch .bash_profile open -e .b...
分类:
移动开发 时间:
2014-07-29 16:49:52
阅读次数:
181
#!/bin/bash
echo?"fdisk?success"
-sed?-i?‘/fdisk.sh/d‘??/etc/rc.d/rc.local
+sed?-i?‘s/fdisk.sh/reboot.sh/‘??/etc/rc.d/rc.local
+?reboot 主要是格式化磁盘,写在 /etc/rc.local 删除不彻底(...
分类:
其他好文 时间:
2014-07-29 16:20:49
阅读次数:
300
#!/bin/bash
#
#Judgingtheelementisafileorafolder
if[$#-lt1];then
echo"ERROE!!Usage:ckfile.shARGS1[ARGS2...]"
exit4
fi
foriin`seq1$#`
do
if[-f$1];then
echo$1isacommomfile
elif[-d$1];then
echo$1isadirectory
else
echo"$1isnotexsitorunknown!"
fi
shift
done知识..
分类:
其他好文 时间:
2014-07-29 16:01:19
阅读次数:
184
企业软件包管理过程中,源中一个服务的安装包有很多版本,导致打包创建索引时非常非常慢,这个shell脚本就是用来解决这个问题。(企业实习时写的第一个脚本)#!/bin/bash
rm-fr~/update2>/dev/null
mkdir~/update
read-p"PleaseinputyourabsolutePATH:(yourpathshouldendwit..
分类:
其他好文 时间:
2014-07-29 15:56:09
阅读次数:
210
环境:centos6.0_x64oracle版本:11g步骤:wgethttp://utopia.knoware.nl/~hlub/rlwrap/rlwrap-0.30.tar.gztarzxvfrlwrap-0.30.tar.gzcdrlwrap-0.30./configuremakemakeinstallvi/home/oracle/.bash_profile最后执行:#.~oracle/.bash_profile这样上下键和回退键都可以使用了。
分类:
数据库 时间:
2014-07-29 15:44:49
阅读次数:
296
录入预算报错时报错:
分析:这个错误是select into 语句返回多行的结果,但具体在哪?
两种方法查找,trace 或者debug
1.trace
启用调试
获取trace文件
-bash-3.2$ tkprof ERPDEV_ora_7532_RICK.trc $HOME/7532_rick.fchela.txt
TK...
分类:
其他好文 时间:
2014-07-29 14:21:58
阅读次数:
214