Skip to content

Instantly share code, notes, and snippets.

@yabbes
Created February 25, 2017 22:50
Embed
What would you like to do?
#!/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