输入参数错误时,退格会出现^H,这个时候只要在脚本顶部加一条语句:stty erase ^h就可以了

#!/bin/sh

stty erase ^h

shell脚本小技巧的更多相关文章

  1. SHELL 脚本小技巧

    脚本很简单,直接上功能介绍及脚本,可以做模板使用: 记录日志,记录脚本开始执行时间.结束时间 usage 函数,脚本需接参数执行,避免误执行,告诉用户,这个脚本的使用方法 加锁,创建锁文件,脚本不允许 ...

  2. Shell脚本小技巧收集

    1.使用python快速搭建一个web服务器 访问端口8000 python -m SimpleHTTPServer 2.获取文件大小 stat -c %s $file stat --printf=' ...

  3. linux运维自动化shell脚本小工具

    linux运维shell 脚本小工具,如要分享此文章,请注明文章出处,以下脚本仅供参考,若放置在服务器上出错,后果请自负 1.检测cpu剩余百分比 #!/bin/bash #Inspect CPU # ...

  4. shell脚本小案例

    1.获取远程ftp数据到本地目录 #!/bin/bash ftp -n<<! open 135.0.24.19 user exchange exchange binary cd /idep ...

  5. shell脚本常用技巧

    shell脚本常用技巧 1.获取随机字符串或数字 ~]#echo $RANDOM | md5sum | cut -c 1-6 ~]#openssl rand -base64 4 | cut -c 1- ...

  6. shell脚本小实例

    本文收集了一堆的shell脚本技巧,我说过,我写博客主要是作一些学习笔记,方便自己查阅,所以,我会搞出这么一篇文章,也没有什么不可理解的.关于这些技巧的出处,诶,我也忘了,可能来自theunixsch ...

  7. shell脚本使用技巧3--调试

    1.使用-x,开启shell脚本的跟踪调试功能 ex:bash -x script.sh or sh -x script.sh 2.使用set -x 和 set +x对脚本进行部分调试(输入中间的内容 ...

  8. shell脚本小集锦

    1) 如何向脚本传递参数 ? ./script argument 例子: 显示文件名称脚本 ./show.sh file1.txt cat show.sh #!/bin/bash 2) 如何在脚本中使 ...

  9. shell脚本调试技巧

    shell脚本调试之工具——bashdb http://www.cnblogs.com/itcomputer/p/5011845.html

随机推荐

  1. AbsListView.OnScrollListener

    public static interface AbsListView.OnScrollListener   android.widget.AbsListView.OnScrollListener 类 ...

  2. system执行shell命令

    system - execute a shell command #include <stdlib.h> int system (const char *command); 描述 syst ...

  3. News: Visual Studio Code support debugging Linux Apps

    http://arstechnica.com/information-technology/2015/11/visual-studio-now-supports-debugging-linux-app ...

  4. SWIFT 通过字符串创建相关的类

    import UIKit @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { var window: ...

  5. websocket 待更新

    https://mp.weixin.qq.com/s?__biz=MjM5OTM0MzIwMQ==&mid=2652545551&idx=1&sn=403b75d95cf191 ...

  6. UICollection 重排 和汉字拼音

    http://nshint.io/blog/2015/07/16/uicollectionviews-now-have-easy-reordering/ NSMutableString *str = ...

  7. iOS截图

    1.普通的截图办法,在View上面截图 /** * 截图代码 * * @param view 需要截图的view * @param rect 需要截取的区域 * * @return 返回截取的对象 * ...

  8. 阿里与腾讯“智慧城市”的O2O谁更强?(分享)

    成都亿合科技:本月22日蚂蚁金服联合新浪微博宣布“智慧城市”战略,用户可通过新浪微博.手机淘宝.支付宝三大客户端完成医疗.市政缴费以及相关信息查询工作,首批入驻城市有上海.太原.深圳.青岛等12个城市 ...

  9. Caused by: org.springframework.core.NestedIOException: ASM ClassReader failed to parse class file

    springframework.version  3.2.6.RELEASE jdk 1.8

  10. Some settings of PostgreSQL

    Here are some setting recommendations about checkpoints, some values to set in postgresql.conf. A ch ...