Skip to content

Instantly share code, notes, and snippets.

@pantaovay
Created December 9, 2013 15:43
Show Gist options
  • Select an option

  • Save pantaovay/7874176 to your computer and use it in GitHub Desktop.

Select an option

Save pantaovay/7874176 to your computer and use it in GitHub Desktop.
合并多行空白
#!/bin/sh
#author: God Tao
multi_blank() {
for filename in `ls -A $1`
do
if [ -d "$1/$filename" ]
then
multi_blank "$1/$filename"
else
cat -s "$1/$filename" > "$1/$filename.cat"
rm -f "$1/$filename"
mv "$1/$filename.cat" "$1/$filename"
fi
done
}
multi_blank .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment