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

你可能感兴趣的:(bash)