`
standalone
  • 浏览: 595869 次
  • 性别: Icon_minigender_1
  • 来自: 上海
社区版块
存档分类
最新评论

Shell Parameter Expansion

阅读更多
http://stackoverflow.com/questions/12671406/bash-removing-part-of-a-string

var="Memory Used: 19.54M"
var=${var#*: }            # Remove everything up to a colon and space
var=${var%M}              # Remove the M at the end
分享到:
评论

相关推荐

    Pro.Bash.Programming.Scripting.the.GNULinux.Shell.2nd.Edition

    Use shell parameter expansion to replace many external commands, making scripts very fast. Learn to avoid many common mistakes that cause scripts to fail. Learn how Bash’s readline and history ...

    Pro Bash Programming

    * Use shell parameter expansion to replace many external commands, making scripts very fast. * Learn to avoid many common mistakes that cause scripts to fail. * Learn how bash's readline and history ...

    Pro Bash Programming 2015

    * Use shell parameter expansion to replace many external commands, making scripts very fast. * Learn to avoid many common mistakes that cause scripts to fail. * Learn how bash's readline and history ...

    3shell扩展1

    这种扩展和 tilde 、 parameter variable 和arithmetic expansion 和 command substitution 起进

    beginning_portable_shell_scripting_from_novice_to_professional.pdf

    Pathname Expansion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .27 Differences from Shell Patterns . . . . . . . . . . . . . . . . . . . . . . . . . . . . ....

    2009 达内Unix学习笔记

    各个 shell 可互相切换 ksh:$ sh:$ csh:guangzhou% bash:bash-3.00$ 一、注意事项 命令和参数之间必需用空格隔开,参数和参数之间也必需用空格隔开。 一行不能超过256个字符;大小写有区分。 二、特殊字符...

    Linux高级bash编程

    Parameter Substitution and Expansion B-5. String Operations B-6. Miscellaneous Constructs C-1. Basic sed operators C-2. Examples of sed operators D-1. "Reserved" Exit Codes L-1. Batch file keywords /...

    Advanced Bash-Scripting Guide <>

    Parameter Substitution and Expansion B-5. String Operations B-6. Miscellaneous Constructs C-1. Basic sed operators C-2. Examples of sed operators D-1. "Reserved" Exit Codes L-1. Batch file keywords /...

    MS-DOS 5.0

    6.9 Mice and MS-DOS Shell 6.10 NCR VGA BIOS 6.11 Olivetti Systems 6.12 Toshiba T3100SX 6.13 Western Digital VGA Card 6.14 Zenith Computers 7. Making Your Network Compatible with MS-DOS 5.0 7.1 ...

    The Art of Assembly Language Programming

    Some Final Comments on the MOV Instructions &lt;br&gt;4.9 Laboratory ...SHELL.ASM File 4.9.4 Assembling Your Code with MASM 4.9.5 Debuggers and CodeView' 4.9.5.1 A Quick Look at CodeView 4.9....

    hadoop_the_definitive_guide_3nd_edition

    Parameter Substitution 408 12. Hive . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 411 Installing Hive 412 The Hive ...

    abs-guide----Advanced Bash-Scripting Guide

    一本深入学习shell脚本艺术的书籍 非常好的书 强烈推荐 附有超多实例 Advanced Bash-Scripting Guide............................................................................................................

Global site tag (gtag.js) - Google Analytics