A summary of how Linux character channeling is intercepted
1. Summary of Commands
----------------------------------------------------------------------------
2. Summary of examples
st1= ' Http://www.baidu.com/image/image.png '
# echo ${st1#*/}/www.baidu.com/image/image.png
# echo ${st1##*/}image.png
----------------------------------------------------------------------------
st1= ' Http://www.baidu.com/image/image.png '
# echo ${st1%/*}http://www.baidu.com/image
# echo ${st1%%/*}http:
-----------------------------------------------------------------------------
st1= ' Http://www.baidu.com/image/image.png '
# echo ${st1:0:4}http
# echo ${st1:7}www.baidu.com/image/image.png
---------------------------------------------------------------------------------------
st1= ' Http://www.baidu.com/image/image.png '
# echo ${st1:0-10:6}/image #不是ge. png because it is a 10th character from the right of the first, that is, 6 characters from the '/'.
# echo ${st1:0-10}/image.png
3. Memory methods
Be sure to divide the intercept, or cut off.
There are 5 symbols, ' # ' # # '% ' of percent '
#
This article is from the "Frog Technology Archive" blog, so be sure to keep this source http://frogtwo.blog.51cto.com/3805708/1939143
Linux ${} Character-channeling method summary