Moves binaries for use with gnu stow

這個提交存在於:
Jonathan Hodgson 2019-07-30 14:06:10 +01:00
父節點 c4f45a7ccc
當前提交 ebbd1dc04d
共有 89 個檔案被更改,包括 0 行新增0 行删除

45
bin/.bin/zip-recent 可執行檔
檢視檔案

@ -0,0 +1,45 @@
#!/usr/bin/sh
# A script to create a zip archive of any recentally modified files
# Set the defaults
mtime="7"
filename=""
while [ $1 ]; do
case $1 in
-h|--help)
echo "Zips recentally modified files"
echo ""
echo -e "Use this to create a zip archive of recentally modified files"
echo -e "Usage: zip-recent [options] filename"
echo ""
echo -e "Options"
echo -e "\t-mtime\t\tThe number of days that should be considered recent [default=$mtime]"
exit 0
;;
-mtime)
shift
mtime="$1"
shift
;;
*)
filename="$1"
shift
;;
esac
done
if [ "$filename" = "" ]; then
echo "You need to enter a filename"
exit 1
fi
# Make sure the filename ends with .zip
filename="${filename%\.zip}.zip"
find . -type f -mtime -$mtime -exec zip $filename {} \;