ITeye博客

Shell Parameter Expansion

standalone · 2016-01-16 13:30 · 编程语言 · Markdown

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

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。