diff --git a/document/linux/config/bash/module/name.sh b/document/linux/config/bash/module/name.sh index 800312f..4240d2d 100644 --- a/document/linux/config/bash/module/name.sh +++ b/document/linux/config/bash/module/name.sh @@ -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.