Skip to content

Instantly share code, notes, and snippets.

@danielnorberg
Created December 30, 2010 21:23
Show Gist options
  • Save danielnorberg/760316 to your computer and use it in GitHub Desktop.
Save danielnorberg/760316 to your computer and use it in GitHub Desktop.
A simple script to recursively remove trailing whitespace from Objective-C source code files in a directory.
#!/bin/bash
if [ $# -gt 0 ]; then
echo
echo Removing trailing whitespace in $1
echo
find $1 -type f -iname '*.[hm]' -exec gsed -i 's/[[:space:]]*$//' '{}' ';'
else
echo
echo Usage:
echo remove-trailing-whitespace [target-dir]
echo
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment