Skip to content

Instantly share code, notes, and snippets.

@jvmvik
Created June 10, 2014 19:26
Show Gist options
  • Save jvmvik/63ac547438a8b7c90ad6 to your computer and use it in GitHub Desktop.
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...
#!/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