Don't leave empty files on disk if extraction fails.
$ unar -p 0403 Certificate.zip
Certificate.zip: Zip
Certificate.pdf (254004 B)... Failed! (Missing or wrong password)
Extraction to current directory failed! (1 file failed.)
$ ls -l
-rw-r--r-- 1 jidanni jidanni 0 01-22 21:28 Certificate.pdf
-rw------- 1 jidanni jidanni 242430 01-22 21:26 Certificate.zip
$ lsar -l Certificate.zip
Certificate.zip: Zip
Flags File size Ratio Mode Date Time Name
===== ========== ===== ==== ========== ===== ====
0. ---E- 254004 4.6% ---- 2022-01-22 09:38 Certificate.pdf
(Flags: D=Directory, R=Resource fork, L=Link, E=Encrypted, @=Extended attributes)
$ lsar -L Certificate.zip
Certificate.zip: Zip
Certificate.pdf:
Name: Certificate.pdf
Size: 254 KB (254004 bytes)
Compressed size: 242 KB (242264 bytes)
Is encrypted: Yes
Last modified: 2022-01-22 09:38:52 +0800
DOS file attributes: ------ (0x00)
Index in file: 0
Start of data: 56
Length of data: 242264
WinZipAESCompressionMethod: 8
WinZipAESKeySize: 3
WinZipAESVendor: 17729
WinZipAESVersion: 2
ZipCRC32: 0x00000000
ZipCompressionMethod: 99
ZipExtractVersion: 20
ZipFileAttributes: 0
ZipFlags: 9
ZipLocalDate: 1412844762
ZipOS: 0
ZipOSName: MS-DOS
P.S., trailing blank spotted:
$ lsar -L Certificate.zip|sed -n '/ $/p'
Certificate.pdf: