Last active
June 22, 2017 07:49
-
-
Save necoyama3/3bb7646772f2a442a82f to your computer and use it in GitHub Desktop.
easy encrypt zip function for .zshrc
This file contains 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
function ze() { | |
if [ $# = 0 ]; then | |
echo "usage: ze [./file] [./dirctory]" | |
else | |
arg=$1 | |
if [ `echo $arg | grep '\.'` ]; then | |
file_name=`echo $arg | cut -d'.' -f1` | |
zip -e "$file_name.zip" $arg | |
else | |
zip -e -r "$arg.zip" $arg | |
fi | |
fi | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment