Created
October 1, 2012 07:24
-
-
Save y-yoshinoya/3810091 to your computer and use it in GitHub Desktop.
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/bash | |
# Create zip archive within multibyte-named files for Windows PC. | |
# (utf-8 -> sjis) | |
# | |
# Dependencies: | |
# sudo apt-get install zip convmv | |
if [ $# -lt 2 ]; then | |
echo "usage: $0 zipfile files" 1>&2 | |
exit 0 | |
fi | |
ZIPFILE=$1 | |
shift | |
FILES=$* | |
DIR=/tmp/zip.$$ | |
mkdir $DIR | |
cp -r $FILES $DIR | |
cd $DIR | |
convmv -f utf-8 -t sjis * --notest | |
zip $ZIPFILE * | |
zipcloak $ZIPFILE | |
cd - | |
mv $DIR/$ZIPFILE . | |
rm -rf $DIR |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment