摘要: shift运行后,$#随之减少;如果需要知道命令行中输入的最后一个参数(通常是一个文件名),可以有两种选择:使用命令 eval echo \$$#;使用shift命令:shift 'expr $# - 2'。getopts 选项字符串 名称 [参数表]每次使用时,getopts 都会把下一个选项放在shell变量名称中(如果名称不存在就初始化它),并把下一个要处理的参数的下标放在变量 OPTIND 中。如果某个选项需要参数,getopts 就把该参数放在变量 OPTARG 中。Shell不会自动把 OPTIND 重置;如果在同一个shell中多次调用 getopts 时要使用新 阅读全文
posted @ 2014-02-17 20:42 baihuahua 阅读(301) 评论(0) 推荐(0) 编辑
摘要: $ git commit -awhich will automatically notice any modified (but not new) files, add them to the index, and commit, all in one step.A note on commit messages: Though not required, it’s a good idea to begin the commit message with a single short (less than 50 character) line summarizing the change, f 阅读全文
posted @ 2014-02-17 20:39 baihuahua 阅读(459) 评论(0) 推荐(0) 编辑