Created
June 10, 2014 19:26
-
-
Save jvmvik/63ac547438a8b7c90ad6 to your computer and use it in GitHub Desktop.
Bash script to tar multiples directories supplied by the user in a single command...
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
#!/bin/bash | |
if [ $# -eq 0 ] | |
then | |
echo "No directory supplied..." | |
fi | |
for f in $*; | |
do | |
echo "Compressing: $f"; | |
tar czf $f.tgz $f | |
chmod a+r $f.tgz | |
echo "Done..." | |
done; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment