summaryrefslogtreecommitdiff
path: root/rmw
diff options
context:
space:
mode:
authorfilip <“filip.rabiega@gmail.com”>2026-01-21 23:42:15 +0100
committerfilip <“filip.rabiega@gmail.com”>2026-01-21 23:42:15 +0100
commit17df35dc088c9b1b159c2b78d8330fa9cc9a672a (patch)
tree052205953f7f11a9ea847a9b4d238f6acdbc25b8 /rmw
parentd127601c83c1a30063b76eb89bf0d9a32ed435b9 (diff)
downloadchadscripts-17df35dc088c9b1b159c2b78d8330fa9cc9a672a.tar.gz
chadscripts-17df35dc088c9b1b159c2b78d8330fa9cc9a672a.tar.bz2
chadscripts-17df35dc088c9b1b159c2b78d8330fa9cc9a672a.zip
reformat most scripts
Diffstat (limited to 'rmw')
-rwxr-xr-xrmw16
1 files changed, 8 insertions, 8 deletions
diff --git a/rmw b/rmw
index 6bd558d..37a2504 100755
--- a/rmw
+++ b/rmw
@@ -2,24 +2,24 @@
# Remove whitespaces in all the files in a given directory
if [ "$#" -gt 1 ]; then
- echo "Usage: rmw <dir>" >&2
- exit 1
+ echo "Usage: rmw <dir>" >&2
+ exit 1
fi
if [ "$#" -eq 0 ]; then
- dir="$(pwd)"
+ dir="$(pwd)"
else
- dir="$1"
+ dir="$1"
fi
cd "$dir" || {
- echo "Couldn't cd to directory. Exiting..." >&2
- exit 1
+ echo "Couldn't cd to directory. Exiting..." >&2
+ exit 1
}
for file in "$dir"/*; do
- newname="$(echo "$file" | sed -e 's/["`”“-]*//g' -e 's/[ \t]+/\_/g')"
- mv "$file" "$newname"
+ newname="$(echo "$file" | sed -e 's/["`”“-]*//g' -e 's/[ \t]+/\_/g')"
+ mv "$file" "$newname"
done
exit 0