diff options
| author | filip <“filip.rabiega@gmail.com”> | 2026-01-18 11:44:26 +0100 |
|---|---|---|
| committer | filip <“filip.rabiega@gmail.com”> | 2026-01-18 11:44:26 +0100 |
| commit | 83954961af8b6337da100e038561f2fd975ac1fe (patch) | |
| tree | 33a45dbf91cc4c0b8975287b9537db8aa272505f /rmw | |
| parent | afd02bfcce54e3252d356f34c25a155c855f3612 (diff) | |
| download | chadscripts-83954961af8b6337da100e038561f2fd975ac1fe.tar.gz chadscripts-83954961af8b6337da100e038561f2fd975ac1fe.tar.bz2 chadscripts-83954961af8b6337da100e038561f2fd975ac1fe.zip | |
Diffstat (limited to 'rmw')
| -rwxr-xr-x | rmw | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -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 |
