Answers:
这样做会削减所有前面的路径元素basename $0。在##试图找到前缀模式的最长匹配的扩展:
$ x=/a/b/c/d
$ echo ${x##*/}
d
$ basename $x
d
从手册页:
${parameter##word}
       Remove matching prefix pattern.  The word is expanded to produce
       a pattern just as in pathname expansion.  If the pattern matches
       the  beginning of the value of parameter, then the result of the
       expansion is the expanded value of parameter with  the  shortest
       matching  pattern  (the ``#'' case) or the longest matching pat‐
       tern (the ``##'' case) deleted.  
使用的原因${0##*/}是它不涉及外部程序调用,但是有点使正在发生的事情难以理解。
man bash然后搜索了parameter##吗?
                    man bash但是愚蠢的我,我搜寻了,${所以找不到匹配的东西。谢谢。