-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] Address mulitple special chars in uploaded data
- Loading branch information
Dan Levitas
committed
Jun 20, 2024
1 parent
7d7b0d2
commit b3ef590
Showing
2 changed files
with
13 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#!/bin/bash | ||
file="$1" | ||
dir=$(dirname "$file") | ||
base=$(basename "$file") | ||
new_base=$(echo "$base" | sed 's/[ @^()]/_/g') | ||
new_file="$dir/$new_base" | ||
|
||
if [[ "$file" != "$new_file" ]]; then | ||
echo "Renaming '$file' to '$new_file'" | ||
mv "$file" "$new_file" | ||
fi |