Created
September 4, 2016 09:09
-
-
Save FreeSlave/2a715628b26a8000a83034000f928c17 to your computer and use it in GitHub Desktop.
Unpack zip archive and convert filenames to utf-8 (e.g. if you got zip archive from Windows)
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 | |
from= | |
to= | |
if [ -z "$1" ] | |
then | |
echo "Error: no arguments" | |
exit 0 | |
else | |
from="$1" | |
fi | |
if [ -z "$2" ] | |
then | |
to=${from%[.]zip} | |
else | |
to="$2" | |
fi | |
unzip "$from" -d "$to" | |
cd "$to" | |
convmv -r -f cp1252 -t cp850 * --notest && convmv -r -f cp866 -t utf-8 * --notest | |
cd .. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment