|
|
#1 |
|
Zip Command Help!
I am trying to preserve the resource forks in font files while zipping them.
The font files are in folders, and I am trying to zip each folder up individually and not just into one big archive. What is the zip parameter to do this? |
|
|
|
0
|
|
|
#2 |
|
Give this a try.
Code:
ls -d /path/to/your/parent/dir | sed 's/^/"/;s/$/"/' | xargs -I {} -n1 zip -r {}.zip {}
|
|
|
|
0
|
|
|
#3 |
|
Thanks
Thanks a bunch, but your script makes my fonts folder into one big archive.
Is their any way that I could do this piece of code to each folder inside on my fonts folder. When I ran it, it just created a large archive of my whole fonts folder and didn't just zip up each folder individually inside of the fonts folder. Thanks, Flashuni For Example Here is my previous script that doesnt work: ## zip the contents of each folder in the current directory into an archive: for d in *; do if [ -d "$d" ]; then cd "$d"; cd ..; fi; done ## zip every folder in the current directory into an archive: for d in *; do if [ -d "$d" ]; then zip -r -j "$d.zip" "$d"; fi; done ## example recursively forces the deletion of the directory if zip returns true: for d in *; do if [ ! -d "$d" ]; then continue fi if ! zip -R -j "$d.zip" "$d"; then continue fi Last edited by flashuni; Jun 8, 2008 at 12:01 PM. |
|
|
|
0
|
|
|
#4 |
|
I'd just use automator.
|
|
|
|
0
|
|
|
#5 |
|
|
0
|
|
|
#6 |
|
To fix the problem with your fonts dir being zipped do this
Code:
ls -d /path/to/your/parent/dir/* | sed 's/^/"/;s/$/"/' | xargs -I {} -n1 zip -r {}.zip {}
What you want fed into the sed command is the list of directories that will be zipped. Do just the "ls -d /path/to/parent/dir/*" command by hand and see if that gives you the folders that you want individually zipped. Sorry about that little slip. You are just feeding something in that is one level too high. It should work with this change. -numero |
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
Similar Threads
|
||||
| thread | Thread Starter | Forum | Replies | Last Post |
| Iomega Zip drives | Stormz | Mac Peripherals | 14 | Mar 16, 2011 10:06 AM |
| Option and Command Moves windows help | Ratstroke | Mac Basics and Help | 4 | Nov 22, 2010 11:04 AM |
| Damaged stuffit zip file. Help! | BLewisMaltz | Mac Applications and Mac App Store | 11 | Mar 9, 2006 01:27 AM |
| Quick US zip code help! | stevehaslip | Community | 38 | Apr 26, 2005 02:21 PM |
| zip drive help | skullsdontfade | Macintosh Computers | 5 | Feb 12, 2004 12:29 PM |
All times are GMT -5. The time now is 04:15 PM.







Linear Mode

