Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
ZIP parameter
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German)
View previous topic :: View next topic  
Author Message
wrdaniel
n00b
n00b


Joined: 30 Dec 2006
Posts: 40

PostPosted: Wed Mar 21, 2007 3:24 pm    Post subject: ZIP parameter Reply with quote

Hallo,

gzip packt ja automatsich bei einem "gzip *" alle Dateien einzeln und löscht die original Dateien. wie kann ich das mit dem normalen zip machen? Alle Dateien in ein Archiv zu packen klappt ja ohne Probleme, aber ich brauche eben jede Datei einzeln und normales ZIP. Einzeln wäre etwas umständlich bei der Menge. Falls jemand gerade die Parameter im Kopf hat ...

Danke, wrdaniel
Back to top
View user's profile Send private message
blice
Guru
Guru


Joined: 12 Feb 2005
Posts: 598
Location: D- 26188

PostPosted: Wed Mar 21, 2007 3:51 pm    Post subject: Reply with quote

zip -m -9 test.zip foo*

Code:

bodo@this ~ $ zip
Copyright (C) 1990-2005 Info-ZIP
Type 'zip "-L"' for software license.
Zip 2.31 (March 8th 2005). Usage:
zip [-options] [-b path] [-t mmddyyyy] [-n suffixes] [zipfile list] [-xi list]
  The default action is to add or replace zipfile entries from list, which
  can include the special name - to compress standard input.
  If zipfile and list are omitted, zip compresses stdin to stdout.
  -f   freshen: only changed files  -u   update: only changed or new files
  -d   delete entries in zipfile    -m   move into zipfile (delete files)
  -r   recurse into directories     -j   junk (don't record) directory names
  -0   store only                   -l   convert LF to CR LF (-ll CR LF to LF)
  -1   compress faster              -9   compress better
  -q   quiet operation              -v   verbose operation/print version info
  -c   add one-line comments        -z   add zipfile comment
  -@   read names from stdin        -o   make zipfile as old as latest entry
  -x   exclude the following names  -i   include only the following names
  -F   fix zipfile (-FF try harder) -D   do not add directory entries
  -A   adjust self-extracting exe   -J   junk zipfile prefix (unzipsfx)
  -T   test zipfile integrity       -X   eXclude eXtra file attributes
  -y   store symbolic links as the link instead of the referenced file
  -R   PKZIP recursion (see manual)
  -e   encrypt                      -n   don't compress these suffixes


a) hätte man aber auch alleine lösen können

b) geht nicht ohne script. zb in bash
_________________
Gentoo seit 2004.3
Skype: bodokhan
SecondLife: Bodokhan Fall
Email: blice@gmx.de
Back to top
View user's profile Send private message
firefly
Watchman
Watchman


Joined: 31 Oct 2002
Posts: 5165

PostPosted: Wed Mar 21, 2007 5:25 pm    Post subject: Reply with quote

das kann das zip programm nicht, da musst du dir schon mit nem script behelfen.

Der grund ist, das zip und gzip zwei grundverschiedene dinge sind.
zip ist ein Archiv-format, welches standard-mäßig den deflate(zlib)-algorithmus verwendet um die dateien zu komprimieren.

gzip und auch bzip2 sind reine komprimierungs programme/algorithmen. Deswegen gibt es ja die tar.gz bzw. tar.bz2 archive. Tar ist das Archiv-format und bzip2 bzw. gzip werden dann zum komprimieren des *.tar archivs verwendet.
_________________
Ein Ring, sie zu knechten, sie alle zu finden,
Ins Dunkel zu treiben und ewig zu binden
Im Lande Mordor, wo die Schatten drohn.
Back to top
View user's profile Send private message
manuels
Advocate
Advocate


Joined: 22 Nov 2003
Posts: 2146
Location: Europe

PostPosted: Wed Mar 21, 2007 5:58 pm    Post subject: Reply with quote

wird sowas hier gesucht?

Code:
for i in 'ls -1'; do echo $i; done
Einfach nur echo durch das entsprechende Kommando ersetzen.
PS: Funktioniert in der Bash
_________________
Build your own live cd with catalyst 2.0!
Back to top
View user's profile Send private message
Aldo
Guru
Guru


Joined: 15 Jan 2003
Posts: 440
Location: Cologne, Germany

PostPosted: Wed Mar 21, 2007 6:59 pm    Post subject: Reply with quote

Code:
for i in 'ls -1'; do echo $i; done


Wenn sie zu verarbeitenden Dateien Leerzeichen enthalten funktioniert das so nicht.
Dann den "Infield Separator" im Script benutzen:
Code:
IFS="
"
[.......]

_________________
Abit A-N78-HD
Phenom 9750
8 GB Ram
Linux 2.6.29-gentoo
FreeBSD 7.2
Back to top
View user's profile Send private message
Fauli
l33t
l33t


Joined: 24 Apr 2004
Posts: 760
Location: Moers, Germany

PostPosted: Wed Mar 21, 2007 9:26 pm    Post subject: Reply with quote

Oder einfach "for i in *":
Code:
for i in *; do zip -m "$i.zip" "$i"; done

_________________
Do your part to beautify the web! Turn off link underlining!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Deutsches Forum (German) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum