zoukankan      html  css  js  c++  java
  • tr用法

    参考:

    http://man.linuxde.net/tr

    shell脚本学习指南

    语法

      tr [options] source-char-list replace-char-list

    用途

      转换字符。例如,将大写字符转换成小写。选项可让你指定要删除的字符,以及将一串重复出现的字符浓缩成一个。

      Translate, squeeze, and/or delete characters from standard input, writing to standard output.

    常用选项

      -c或--complement:取代所有不属于第一字符集的字符;use the complement of source-char-list

      -d或--delete:删除所有属于第一字符集的字符;delete characters in source-char-list, do not translate

      -s或--squeeze-repeats:把连续重复的字符以单独一个字符表示;replace each input sequence of a repeated character that is listed in source-char-list with a single occurrence of that character.

      -t或--truncate-set1:先删除第一字符集较第二字符集多出的字符。

    支持的字符集

           [:alnum:]  all letters and digits

           [:alpha:]  all letters

           [:blank:]  all horizontal whitespace

           [:cntrl:]  all control characters

           [:digit:]  all digits

           [:graph:]  all printable characters, not including space

           [:lower:]  all lower case letters

           [:print:]  all printable characters, including space

           [:punct:]  all punctuation characters

           [:space:]  all horizontal or vertical whitespace

           [:upper:]   all upper case letters

           [:xdigit:]  all hexadecimal digits

           [=CHAR=]  all characters which are equivalent to CHAR

    举例

      将小写字符转换为大写字母

          tr [:lower:] [:upper:]

  • 相关阅读:
    delphi中httpencode使用注意事项
    如何消去delphi Stringgrid重绘时产生重影
    delphi在64位系统下写注册表注意事项
    通过注册表修改IE的Internet选项
    TList TObjectList的区别和使用
    Delphi7如何实现让Tedit显示文字垂直居中(上下居中)
    delphi 在代码中 添加 TO-DO 并且 管理
    python爬虫学习笔记(二)-工具的使用
    python爬虫学习笔记(一)-爬虫介绍
    永恒之蓝漏洞的利用测试
  • 原文地址:https://www.cnblogs.com/embedded-linux/p/6227899.html
Copyright © 2011-2022 走看看