Added option to define the directory as well as the necessary bash-it arguments

pull/248/head
jimmynotjim 2013-12-19 10:19:04 -05:00
parent af402cc6f0
commit b198e3e8fa
1 changed files with 7 additions and 1 deletions

View File

@ -177,7 +177,13 @@ command_exists ()
batch_zip ()
{
for f in *; do zip "${f%%.*}.zip" "$f"; done
about 'individually compresses each file in a directory'
param '1: directory name'
example '$ batch_zip'
example '$ batch_zip ~/PDFs'
group 'base'
[ -z ${1+x} ] && local directory=${PWD} || local directory=$1
for f in "${directory}"/*; do zip "${f%%.*}.zip" "$f"; done
}
# useful for administrators and configs