|
关于 ${parameter ffset:length} 的用法,man bash中解释如下:
Substring Expansion.
...
If offset evaluates to a number less than zero, the value is
used as an offset from the end of the value of parameter.
...
我的问题如下:
> echo $mypara
abcdef
> echo ${mypara:3:2}
de
> echo ${mypara:-3:2}
abcdef #为什么会这样? 我以为是 de |
|