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