mirror of
https://github.com/natelandau/shell-scripting-templates.git
synced 2025-11-10 14:13:45 -05:00
keep '_' in alphanumeric
This commit is contained in:
@@ -73,9 +73,9 @@ _cleanString_() {
|
|||||||
&& string="$(echo "${string}" | tr '[:lower:]' '[:upper:]')"
|
&& string="$(echo "${string}" | tr '[:lower:]' '[:upper:]')"
|
||||||
|
|
||||||
if "${alphanumeric}" && "${us}"; then
|
if "${alphanumeric}" && "${us}"; then
|
||||||
string="$(echo "${string}" | tr -c '[:alnum:] -' ' ')"
|
string="$(echo "${string}" | tr -c '[:alnum:] -_' ' ')"
|
||||||
elif "${alphanumeric}"; then
|
elif "${alphanumeric}"; then
|
||||||
string="$(echo "${string}" | sed "s/[^a-zA-Z0-9 -]//g")"
|
string="$(echo "${string}" | sed "s/[^a-zA-Z0-9 -_]//g")"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if "${replace}"; then
|
if "${replace}"; then
|
||||||
|
|||||||
Reference in New Issue
Block a user