Created
February 25, 2017 22:50
-
-
Save yabbes/87fea074ca7ac2f4fe5f18d1834fc0f0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/awk -f | |
BEGIN{ | |
occ = 0 | |
} | |
{ | |
if (substr($0, length($0)-1, length($0)) == "[:space:]") { | |
printf("Space alert at line %d\n", NR) | |
print $0 | |
occ += 1 | |
} | |
} | |
END{ | |
if (occ != 0){ | |
printf("Found %d spaces at line endings", occ) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment