博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Shell变量
阅读量:2359 次
发布时间:2019-05-10

本文共 627 字,大约阅读时间需要 2 分钟。

 特殊变量

    命令                   意义
    $#                   传递到脚本的参数列表
    $?                    前个命令执行情况,0成功,其它值失败
    $$                    脚本运行的当前进程号
    $!                     运行脚本最后一个命令
    $*                    显示脚本全部参数

 

 

by dradhzn

1 - denotes stdout ( standard output )

2 - denotes stderr  ( standard error )
/dev/null .   apparently is null , nothing , empty , zero etc , etc .
2>/dev/null   - redirect stderr to nothing , it turns stderr off.
>/dev/null 2>&1   also can write  as  1>/dev/null 2>&1     - stdout redirect to /dev/null (no stdout) ,and redirect stderr to stdout  (stderr gone as well) .  end up it turns both stderr and stdout off
a little practice may help to undstand above . 
#ls /usr  /nothing
#ls /usr  /nothing  2>/dev/null
#ls /usr  /nothing  >/dev/null 2>&1

 

 

转载地址:http://uentb.baihongyu.com/

你可能感兴趣的文章
Windows CE 5.0启动过程分析
查看>>
什么是数据库索引
查看>>
Webpack 基础与配置
查看>>
尾调用优化(Tail Call Optimization)
查看>>
前端书籍推荐
查看>>
git常用操作
查看>>
JS+Canvas绘画&导出图片
查看>>
JS忍者秘籍-函数重载
查看>>
集合及concurrent并发包总结
查看>>
读“DataBase Sharding at Netlog”,看DataBase Scale Out
查看>>
Redis
查看>>
毕业快两年了
查看>>
ROS学习笔记(1)
查看>>
lucene的中文分词器http://www.blogjava.net/dreamstone/archive/2007/06/22/125726.html
查看>>
ICTCLAS分词系统Java调用接口在Eclipse中的安装 http://blog.csdn.net/CloneIQ/archive/2006/07/20/945909.aspx
查看>>
在基于Struts构架的Java Web项目中加入ICTCLAS分词http://blog.csdn.net/CloneIQ/archive/2006/08/09/1043088.aspx
查看>>
QQ尾巴病毒的发送原理分析http://www.bitscn.com/hack/virus/200607/46309.html
查看>>
手把手教你把Vim改装成一个IDE编程环境(图文)http://blog.csdn.net/wooin/archive/2007/10/31/1858917.aspx
查看>>
Skydrive 微软1G免费网盘申请
查看>>
什么是SEO http://www.seozone.net/search-engine-optimization/what-is-seo.html
查看>>