Created
January 12, 2013 02:20
-
-
Save snowleung/4515715 to your computer and use it in GitHub Desktop.
hide the empty file with git
This file contains hidden or 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
#!/bin/sh | |
FILE_NAME='empty' | |
if [ $1 ! = ''] && [$1 = '-f' ] && [$2 != ''];then | |
FILE_NAME = $2 | |
else | |
echo '=====================================================' | |
echo 'cleana.sh -f filename ' | |
echo ' set the file name,if not,default name is '$FILE_NAME | |
echo '=====================================================' | |
fi | |
FILE_LIST=`find . -name $FILE_NAME` | |
#echo $FILE_LIST | |
for f in $FILE_LIST; | |
do | |
# echo $f; | |
DST_PATH=`dirname $f` | |
echo 'start execute mv '$f $DST_PATH'/.'$FILE_NAME | |
mv $f $DST_PATH'/.'$FILE_NAME | |
echo 'success\n' | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment