假设变量包含空格,换行符和制表符后跟一些文本,为什么会这样:
${var#"${var%%[![:space:]]*}"} # strip var of everything # but whitespace # then remove what's left # (i.e. the whitespace) from var
删除空格并保留文本,但是这样:
${var##[:space:]*} # strip all whitespace from var
才不是?