%/和#/
#!/bin/sh
files=`find -name *.conifg`
for i in $files
do
name=${
i#*/}
dir=${
name%/*}
done
i=this/is/a/path.config
name=is/a/path.config
dir=this/is/a
# ${string#substring}Strip shortest match of $substring from front of $string
# ${string%substring}Strip shortest match of $substring from back of $string
# #代表删除从前往后最小匹配的内容
# %代表删除从后往前最小匹配的内容