Skip to content

Instantly share code, notes, and snippets.

@lidaobing
Created April 6, 2011 14:02
Show Gist options
  • Select an option

  • Save lidaobing/905697 to your computer and use it in GitHub Desktop.

Select an option

Save lidaobing/905697 to your computer and use it in GitHub Desktop.
convert rar to zip
#!/bin/sh
set -e
if [ $# != 1 ]; then
echo "Usage: `basename $0` FOO.rar"
exit 2
fi
RAR_PATH="`pwd`/$1"
ZIP_PATH="`pwd`/`basename $1 .rar`.zip"
TMPDIR=`mktemp -d`
cd "$TMPDIR"
unrar x "$RAR_PATH"
zip "$ZIP_PATH" *
rm -rf "$TMPDIR"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment