diff options
Diffstat (limited to 'scripts/whitespace')
-rwxr-xr-x | scripts/whitespace | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/scripts/whitespace b/scripts/whitespace new file mode 100755 index 0000000..464cf92 --- /dev/null +++ b/scripts/whitespace @@ -0,0 +1,15 @@ +#!/bin/bash + +if [ $# -eq 0 ]; then + echo No arguments + exit 1 +fi + +FILES=() + +for arg in $@; do + [ -d $arg ] && FILES+=($(find $arg -type f)) + [ -f $arg ] && FILES+=($arg) +done + +grep -IHn -e ".*\s$" ${FILES[@]} |