Hi Todd,
I'm glad that you reply my post. Actually, I did something like this:
for x in *.txt
do
zip $x $x.txt // Since it have the same name
done
But I had to do lots of documentation. I use to do a little script shell
at school.
On Tue, 2004-01-06 at 01:22, Todd Slater wrote:
> On Mon, Jan 05, 2004 at 07:09:45PM -0500, song wrote:
> > Hi everybody,
> > I would like to make this cool command of to zip some file. Let's say I have a
> > folder containing a.txt, a.zip, b.txt, b.zip, etc...
> > I would like to add the text file to the zip file with the right name,
> > exemple: a.txt in a.zip; b.txt in b.zip; c.txt in c.zip; etc...
> > I've tried grep function but with no succes. Right now, I do it manually,
> > like:
> > zip a a.txt
> > zip b b.txt
> > zip c c.txt
> > etc...
> > Anybody could help me?
>
> Not tested.
>
> for i in *.txt
> do
> zip `echo $i|sed s/\.txt/\.zip/` $i
> done
>
> Will work with files with spaces in the name if you quote $i's.
>
> grep is for searching for occurences of a pattern in a file or output.
>
>
> Todd
>
>
> ______________________________________________________________________
>
> Want to buy your Pack or Services from MandrakeSoft?
> Go to http://www.mandrakestore.com
Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com