Zipping without extension

I currently have a code that find and zip all files in current folder and zip it, the problem is the name of the zip will include the extension as well and I don't want it.

for ex:

Volvo-red.swf -> Volvo-red.swf.zip

find . -maxdepth 1 -type f ! -name ".*" -exec bash -c 'zip -r "$0.zip" "$0"' {} \;

What's the trick to ignore the extension and only use the name like?

like: Volvo-red.swf -> Volvo-red.zip

Appreciate any response.

zip list.zip list.txt

takes list.txt -> zip -> list.zip

This find files *.txt older than 30 days and converts them to zip archive with the name as you want. bash example:

find . -type f -mtime +30 -name '*.txt' |
while read f
do
  zip ${f/txt/zip}  $f
done

zip archivename filename ...filename ...filename is the syntax.

I'm confused of the code, it seem to zip all into one file. I want to find each file and zip each separately. Anyway to modify from my existing line?

find . -maxdepth 1 -type f ! -name ".*" -exec bash -c 'zip -r "$0.zip" "$0"' {} \;

---------- Post updated at 01:33 PM ---------- Previous update was at 10:25 AM ----------

but avoid including the extension in the name

What keeps you from using jim mcnamara's proposal, eventually adapted a bit to fulfill your needs?

The code doesn't seem to run. I put them in an executable file as zthis then run ./zthis. The directory have a few test file of .txt. Am I missing something?

I don't understand this line:
zip archivename filename ...filename ...filename is the syntax. Is this part of the code or command line?

That is an example for the syntax. WHAT doesn't seem to run - looks perfect to me...

zip archivename filename ...filename ...filename

correct me if I'm wrong but isn't this line zip all file into one archivename? I want to zip each file into their own zip using the that file as the name.

ex:
Volvo-red.swf -> Volvo-red.zip
Volvo-blue.swf -> Volvo-blue.zip
Volvo-six.swf -> Volvo-six.zip

---------- Post updated at 03:24 PM ---------- Previous update was at 03:04 PM ----------

Nevermind it work now, I have to remove the -mtime +30 not sure why jim include that. Thanks.