Skip to content

Instantly share code, notes, and snippets.

@yabbes
Created February 25, 2017 22:50
Show Gist options
  • Save yabbes/87fea074ca7ac2f4fe5f18d1834fc0f0 to your computer and use it in GitHub Desktop.
Save yabbes/87fea074ca7ac2f4fe5f18d1834fc0f0 to your computer and use it in GitHub Desktop.
#!/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