Skip to content

Instantly share code, notes, and snippets.

@snowleung
Created January 12, 2013 02:20
Show Gist options
  • Save snowleung/4515715 to your computer and use it in GitHub Desktop.
Save snowleung/4515715 to your computer and use it in GitHub Desktop.
hide the empty file with git
#!/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