summaryrefslogtreecommitdiff
path: root/rmw
diff options
context:
space:
mode:
authorfilip <“filip.rabiega@gmail.com”>2026-01-18 11:44:26 +0100
committerfilip <“filip.rabiega@gmail.com”>2026-01-18 11:44:26 +0100
commit83954961af8b6337da100e038561f2fd975ac1fe (patch)
tree33a45dbf91cc4c0b8975287b9537db8aa272505f /rmw
parentafd02bfcce54e3252d356f34c25a155c855f3612 (diff)
downloadchadscripts-master.tar.gz
chadscripts-master.tar.bz2
chadscripts-master.zip
huge changesHEADmaster
Diffstat (limited to 'rmw')
-rwxr-xr-xrmw16
1 files changed, 8 insertions, 8 deletions
diff --git a/rmw b/rmw
index 6331204..f84689f 100755
--- a/rmw
+++ b/rmw
@@ -1,24 +1,24 @@
#!/bin/sh
if [ "$#" -gt 1 ]; then
- echo "Usage: rm_whitespaces <dir>" >&2
- exit 1
+ echo "Usage: rm_whitespaces <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