View Single Post
Old September 16th, 2013, 05:30 PM   #923 (permalink)
palmtree5
Sunny Vacation Supporter!
 
palmtree5's Avatar
 
Join Date: May 2012
Location: USA
Gender: Male
Posts: 3,736
 
Device(s): HTC One SV, Samsung Galaxy Prevail (retired), Nexus 7 (Gen 1)
Carrier: Boost Mobile

Thanks: 2,419
Thanked 2,206 Times in 1,162 Posts
Default

Quote:
Originally Posted by palmtree5 View Post
Got it!

[HIGH]#!/bin/bash
SUBDIR=$1
cd $SUBDIR
for SUBDIR2 in `ls -d1 ./*`
do ZIPFILE=`basename $SUBDIR2`
zip -r $ZIPFILE.zip $SUBDIR2
done
[/HIGH]
Quote:
Originally Posted by MoodyBlues View Post
Excellent!

There's potential for all sorts of variations. Damn, I love *nix.
Something I just found out the hard way is this doesn't deal with directories that contain spaces in their names...
__________________
Find a post helpful? Hit
See spam or something offensive? Hit
New to the site? Site Rules/Guidelines and Introductions
Not a member yet but want to join? Join here!
Want to chat with staff?Here
Want to chat with mods?Here
palmtree5 is online now  
Reply With Quote