bash : name : improve pattern matching.
This commit is contained in:
parent
c4cef8a0f8
commit
30e0c964a2
|
@ -20,9 +20,10 @@ name()
|
|||
new_name=$(echo "$file" | \
|
||||
sed -e "s/ /_/g" \
|
||||
-e "s/[^[:alnum:]\._-]//g" \
|
||||
-e "s/_\+/_/g" -e "s/\.\+/\./g" -e "s/-\+/-/g" \
|
||||
-e "s/_-/_/g" -e "s/-_/_/g" -e "s/\.-/_/g" -e "s/-\./_/g" -e "s/\._/_/g" -e "s/_\./_/g" \
|
||||
-e "s/_\+/_/g" \
|
||||
-e "s/_-_/_/g" \
|
||||
-e "s/^_\+//"
|
||||
-e "s/^_//" -e "s/_$//"
|
||||
)
|
||||
|
||||
# status line.
|
||||
|
|
Reference in a new issue