Created
April 6, 2011 14:02
-
-
Save lidaobing/905697 to your computer and use it in GitHub Desktop.
convert rar to zip
This file contains hidden or 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/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