diff options
| author | filip <“filip.rabiega@gmail.com”> | 2026-01-21 23:42:15 +0100 |
|---|---|---|
| committer | filip <“filip.rabiega@gmail.com”> | 2026-01-21 23:42:15 +0100 |
| commit | 17df35dc088c9b1b159c2b78d8330fa9cc9a672a (patch) | |
| tree | 052205953f7f11a9ea847a9b4d238f6acdbc25b8 /rmw | |
| parent | d127601c83c1a30063b76eb89bf0d9a32ed435b9 (diff) | |
| download | chadscripts-17df35dc088c9b1b159c2b78d8330fa9cc9a672a.tar.gz chadscripts-17df35dc088c9b1b159c2b78d8330fa9cc9a672a.tar.bz2 chadscripts-17df35dc088c9b1b159c2b78d8330fa9cc9a672a.zip | |
reformat most scripts
Diffstat (limited to 'rmw')
| -rwxr-xr-x | rmw | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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 |
