Skip to main content
Commonmark migration
Source Link

If you don't have and cannot install zipinfo for any reason, you can imitate it by using unzip with -Z option. To list the contents of the zip use unzip -Z1:

pw="$(unzip -Z1 file1.zip | cut -f1 -d'.')" unzip -P "$pw" file1.zip 

Put it to a loop:

zipfile="file1.zip" while unzip -Z1 "$zipfile" | head -n1 | grep "\.zip$"; do next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" unzip -P "${next_zipfile%.*}" "$zipfile" zipfile="$next_zipfile" done 

or a recursive function:

unzip_all() { zipfile="$1" next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" if echo "$next_zipfile" | grep "\.zip$"; then unzip -P "${next_zipfile%%.*}" "$zipfile" unzip_all "$next_zipfile" fi } unzip_all "file1.zip" 

-Z zipinfo(1) mode. If the first option on the command line is -Z, the remaining options are taken to be zipinfo(1) options. See the appropriate manual page for a description of these options.

 

-1 : list filenames only, one per line. This option excludes all others; headers, trailers and zipfile comments are never printed. It is intended for use in Unix shell scripts.

If you don't have and cannot install zipinfo for any reason, you can imitate it by using unzip with -Z option. To list the contents of the zip use unzip -Z1:

pw="$(unzip -Z1 file1.zip | cut -f1 -d'.')" unzip -P "$pw" file1.zip 

Put it to a loop:

zipfile="file1.zip" while unzip -Z1 "$zipfile" | head -n1 | grep "\.zip$"; do next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" unzip -P "${next_zipfile%.*}" "$zipfile" zipfile="$next_zipfile" done 

or a recursive function:

unzip_all() { zipfile="$1" next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" if echo "$next_zipfile" | grep "\.zip$"; then unzip -P "${next_zipfile%%.*}" "$zipfile" unzip_all "$next_zipfile" fi } unzip_all "file1.zip" 

-Z zipinfo(1) mode. If the first option on the command line is -Z, the remaining options are taken to be zipinfo(1) options. See the appropriate manual page for a description of these options.

 

-1 : list filenames only, one per line. This option excludes all others; headers, trailers and zipfile comments are never printed. It is intended for use in Unix shell scripts.

If you don't have and cannot install zipinfo for any reason, you can imitate it by using unzip with -Z option. To list the contents of the zip use unzip -Z1:

pw="$(unzip -Z1 file1.zip | cut -f1 -d'.')" unzip -P "$pw" file1.zip 

Put it to a loop:

zipfile="file1.zip" while unzip -Z1 "$zipfile" | head -n1 | grep "\.zip$"; do next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" unzip -P "${next_zipfile%.*}" "$zipfile" zipfile="$next_zipfile" done 

or a recursive function:

unzip_all() { zipfile="$1" next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" if echo "$next_zipfile" | grep "\.zip$"; then unzip -P "${next_zipfile%%.*}" "$zipfile" unzip_all "$next_zipfile" fi } unzip_all "file1.zip" 

-Z zipinfo(1) mode. If the first option on the command line is -Z, the remaining options are taken to be zipinfo(1) options. See the appropriate manual page for a description of these options.

-1 : list filenames only, one per line. This option excludes all others; headers, trailers and zipfile comments are never printed. It is intended for use in Unix shell scripts.

deleted 1 character in body
Source Link
pLumo
  • 23.2k
  • 2
  • 43
  • 70

If you don't have and cannot install zipinfo for any reason, you can imitate it by using unzip with -Z option. To list the contents of the zip use unzip -Z1:

pw="$(unzip -Z1 file1.zip | cut -f1 -d'.')" unzip -P "$pw" file1.zip 

Put it to a loop:

zipfile="file1.zip" while unzip -Z1 "$zipfile" | head -n1 | grep "\.zip$"; do next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" unzip -P "${next_zipfile%%next_zipfile%.*}" "$zipfile" zipfile="$next_zipfile" done 

or a recursive function:

unzip_all() { zipfile="$1" next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" if echo "$next_zipfile" | grep "\.zip$"; then unzip -P "${next_zipfile%%.*}" "$zipfile" unzip_all "$next_zipfile" fi } unzip_all "file1.zip" 

-Z zipinfo(1) mode. If the first option on the command line is -Z, the remaining options are taken to be zipinfo(1) options. See the appropriate manual page for a description of these options.

-1 : list filenames only, one per line. This option excludes all others; headers, trailers and zipfile comments are never printed. It is intended for use in Unix shell scripts.

If you don't have and cannot install zipinfo for any reason, you can imitate it by using unzip with -Z option. To list the contents of the zip use unzip -Z1:

pw="$(unzip -Z1 file1.zip | cut -f1 -d'.')" unzip -P "$pw" file1.zip 

Put it to a loop:

zipfile="file1.zip" while unzip -Z1 "$zipfile" | head -n1 | grep "\.zip$"; do next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" unzip -P "${next_zipfile%%.*}" "$zipfile" zipfile="$next_zipfile" done 

or a recursive function:

unzip_all() { zipfile="$1" next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" if echo "$next_zipfile" | grep "\.zip$"; then unzip -P "${next_zipfile%%.*}" "$zipfile" unzip_all "$next_zipfile" fi } unzip_all "file1.zip" 

-Z zipinfo(1) mode. If the first option on the command line is -Z, the remaining options are taken to be zipinfo(1) options. See the appropriate manual page for a description of these options.

-1 : list filenames only, one per line. This option excludes all others; headers, trailers and zipfile comments are never printed. It is intended for use in Unix shell scripts.

If you don't have and cannot install zipinfo for any reason, you can imitate it by using unzip with -Z option. To list the contents of the zip use unzip -Z1:

pw="$(unzip -Z1 file1.zip | cut -f1 -d'.')" unzip -P "$pw" file1.zip 

Put it to a loop:

zipfile="file1.zip" while unzip -Z1 "$zipfile" | head -n1 | grep "\.zip$"; do next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" unzip -P "${next_zipfile%.*}" "$zipfile" zipfile="$next_zipfile" done 

or a recursive function:

unzip_all() { zipfile="$1" next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" if echo "$next_zipfile" | grep "\.zip$"; then unzip -P "${next_zipfile%%.*}" "$zipfile" unzip_all "$next_zipfile" fi } unzip_all "file1.zip" 

-Z zipinfo(1) mode. If the first option on the command line is -Z, the remaining options are taken to be zipinfo(1) options. See the appropriate manual page for a description of these options.

-1 : list filenames only, one per line. This option excludes all others; headers, trailers and zipfile comments are never printed. It is intended for use in Unix shell scripts.

deleted 43 characters in body
Source Link
pLumo
  • 23.2k
  • 2
  • 43
  • 70

If you don't have and cannot install zipinfo for any reason, you can imitate it by using unzip with -Z option. To list the contents of the zip use unzip -Z1:

pw="$(unzip -Z1 file1.zip | cut -f1 -d'.')" unzip -P "$pw" file1.zip 

Put it to a loop:

zipfile="file1.zip" while unzip -Z1 "$zipfile" | head -n1 | grep "\.zip$"; do next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" unzip -P "${next_zipfile%%.*}" "$zipfile" zipfile="$next_zipfile" done 

or a recursive function:

unzip_all() { zipfile="$1" next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" if echo "$next_zipfile" | grep "\.zip$"; then unzip -P "${next_zipfile%%.*}" "$zipfile" unzip_all "$next_zipfile" else echo "Finished" fi } unzip_all "file1.zip" 

-Z zipinfo(1) mode. If the first option on the command line is -Z, the remaining options are taken to be zipinfo(1) options. See the appropriate manual page for a description of these options.

-1 : list filenames only, one per line. This option excludes all others; headers, trailers and zipfile comments are never printed. It is intended for use in Unix shell scripts.

If you don't have and cannot install zipinfo for any reason, you can imitate it by using unzip with -Z option. To list the contents of the zip use unzip -Z1:

pw="$(unzip -Z1 file1.zip | cut -f1 -d'.')" unzip -P "$pw" file1.zip 

Put it to a loop:

zipfile="file1.zip" while unzip -Z1 "$zipfile" | grep "\.zip$"; do next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" unzip -P "${next_zipfile%%.*}" "$zipfile" zipfile="$next_zipfile" done 

or a recursive function:

unzip_all() { zipfile="$1" next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" if echo "$next_zipfile" | grep "\.zip$"; then unzip -P "${next_zipfile%%.*}" "$zipfile" unzip_all "$next_zipfile" else echo "Finished" fi } unzip_all "file1.zip" 

-Z zipinfo(1) mode. If the first option on the command line is -Z, the remaining options are taken to be zipinfo(1) options. See the appropriate manual page for a description of these options.

-1 : list filenames only, one per line. This option excludes all others; headers, trailers and zipfile comments are never printed. It is intended for use in Unix shell scripts.

If you don't have and cannot install zipinfo for any reason, you can imitate it by using unzip with -Z option. To list the contents of the zip use unzip -Z1:

pw="$(unzip -Z1 file1.zip | cut -f1 -d'.')" unzip -P "$pw" file1.zip 

Put it to a loop:

zipfile="file1.zip" while unzip -Z1 "$zipfile" | head -n1 | grep "\.zip$"; do next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" unzip -P "${next_zipfile%%.*}" "$zipfile" zipfile="$next_zipfile" done 

or a recursive function:

unzip_all() { zipfile="$1" next_zipfile="$(unzip -Z1 "$zipfile" | head -n1)" if echo "$next_zipfile" | grep "\.zip$"; then unzip -P "${next_zipfile%%.*}" "$zipfile" unzip_all "$next_zipfile" fi } unzip_all "file1.zip" 

-Z zipinfo(1) mode. If the first option on the command line is -Z, the remaining options are taken to be zipinfo(1) options. See the appropriate manual page for a description of these options.

-1 : list filenames only, one per line. This option excludes all others; headers, trailers and zipfile comments are never printed. It is intended for use in Unix shell scripts.

added 256 characters in body
Source Link
pLumo
  • 23.2k
  • 2
  • 43
  • 70
Loading
deleted 2 characters in body
Source Link
pLumo
  • 23.2k
  • 2
  • 43
  • 70
Loading
added 126 characters in body
Source Link
pLumo
  • 23.2k
  • 2
  • 43
  • 70
Loading
Source Link
pLumo
  • 23.2k
  • 2
  • 43
  • 70
Loading