2013-03-19 20 views
16

GNU/Linux'ta base64 dosyasını çözmeyi denedim, "base64: geçersiz giriş" alıyorum. decode base64: geçersiz giriş

$ base64 test.zip | base64 -d > test2.zip 
base64: invalid input 
$ ll test* 
-rw-r--r-- 1 user grp 152 19 11:41 test.zip 
-rw-r--r-- 1 user grp 57 19 11:42 test2.zip 

Ben dos2unix komutu çalıştı, ama yardım etmedi.

Benim base64 sürümü:

$ base64 --version 
base64 (GNU coreutils) 5.97 
Copyright (C) 2006 Free Software Foundation, Inc. 
This is free software. You may redistribute copies of it under the terms of 
the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. 
There is NO WARRANTY, to the extent permitted by law. 

Written by Simon Josefsson. 
+0

Sistemimde en azından, -D'yi çözmek değil, -d' değil. Base64 - help sisteminizde ne diyor? –

+0

Yükseltmeyi düşünün; Mevcut sürüm en az 8.20 (2012) ve muhtemelen daha yeni. –

+0

Bu sürüm, CentOS 5.x'in yüklediği şeydir, bu yüzden çevreyi kimin kontrol ettiğini bağlı olarak seçeneği olmayabilir. – Joe

cevap

37

versiyonu ayırıcılar ile çizgilerle (varsayılan olarak) deşifre olmayacak Yani, henüz kodlayıcı varsayılan olarak bunu yapıyor. (Yeni sürümler bu sorunu yok.)

Bir çözüm:

base64 -w 0 foo.zip | base64 -d > foo2.zip

Alternatif:

base64 foo.zip | base64 -di > foo2.zip

-i seçenek açılımı (man sayfasından):

-i, --ignore-garbage 
     When decoding, ignore non-alphabet characters. 
[...] 
Decoding require compliant input by default, use --ignore-garbage to 
attempt to recover from non-alphabet characters (such as newlines) 
İlgili konular