Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I want to add files to a zip archive using the zip command: zip -m myZip.zip file-1.doc but I want to rename file-1.doc to 1.doc before I move it ...
  1. #1
    Just Joined!
    Join Date
    Nov 2006
    Posts
    5

    Zip archives

    Hi,

    I want to add files to a zip archive using the zip command:

    zip -m myZip.zip file-1.doc

    but I want to rename file-1.doc to 1.doc before I move it to the zip file.

    Can someone please help me with this? (I don't want to rename the file first and then zip it - I want to rename it in the zip file, if that makes sense)

    Thanks,

    Robert Hofmeyr

  2. #2
    Linux User
    Join Date
    Feb 2006
    Posts
    484
    laziness is an unaccepteble flavor if you era using linux

  3. #3
    Just Joined! soccercisco's Avatar
    Join Date
    Dec 2006
    Location
    So. Cal
    Posts
    98
    write a shell script called imlazy.sh that does it automatically (you can execute it in one step)



    Cheers,

  4. #4
    Just Joined!
    Join Date
    Nov 2006
    Posts
    5
    Thanks ya'll.

    But the laziness isn't the problem. I'm outputting files as they appear in a list sequence from 1... upwards. If I write the files to the folder and someone else runs the process concurrently I'll get files overwriting files. Not ideall. All I want to know is if there's someway to pipe output into a zip file? Or even just add files to a zip file but changing the filename in the process?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •