您的位置:首页 > 运维架构 > Shell

shell脚本(随笔)

2016-06-21 17:06 435 查看
if [ -n $string ]          如果string非空,返回true;

if [ int1 -ne int2 ]     如果不等于

shift $2                     参数向左传递

$(cd "$(dorname $0)"; pwd)      当前文件所在目录

`basename ${x}`

if [ -f file ]                   如果文件存在且是普通文件

if [ -e file ]                  如果文件存在

notify-send string;   系统通知

/dev/null                    写入它的内容都会丢失,读取返回空

$0                               脚本本身文件

mutt                            邮件客户端

make -c dir -f Makefile.am        -c  切换到指定目录;  -f 指定makefile文件

echo "hello" >> /etc/a.test         写入文件

echo "hello" >  /etc/a.test          写入并覆盖
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: