---
title: "Shell Parameter Expansion"
author: "standalone"
date: "2016-01-16T13:30:22Z"
tags: []
categories: ["编程语言"]
slug: "shell-parameter-expansion"
draft: false
lastmod: "2016-01-16T13:30:22Z"
id: 2271526
url: "https://standalone.iteye.com/blog/2271526"
---

http://stackoverflow.com/questions/12671406/bash-removing-part-of-a-string


```bash

var="Memory Used: 19.54M"
var=${var#*: }            # Remove everything up to a colon and space
var=${var%M}              # Remove the M at the end

```