Created
December 6, 2021 20:16
-
-
Save sxiii/f3e187707fdf0639aae7898623101bb0 to your computer and use it in GitHub Desktop.
Convert ZIP with Windows filepaths to Linux (/ instead of \)
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
# Convert ZIP archive with Windows paths inside it to UNIX paths (backslashes \ to normal slashes / in paths) | |
# You need 7zip package for that matter | |
# Archive in this example is called windows.zip -> don't forget to change it in two places | |
# The script works well even with large files (I tested on 8 GB file; it took couple of seconds) | |
# Resuling file can be unpacked OK with normal Linux tools | |
7z rn windows.zip $(7z l windows.zip | grep '\\' | awk '{ print $6, gensub(/\\/, "/", "g", $6); }' | paste -s) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment