The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Script to count files and get the disk usgae on individual mail folders phpfreak Shell Programming and Scripting 1 05-17-2008 05:15 PM
shell script to find and copy the files creted in the year 2006 to another directory manas6 Shell Programming and Scripting 2 04-01-2008 04:04 AM
shell script: deleting files from a directory onlyc Shell Programming and Scripting 1 07-09-2006 07:41 AM
Converting Shell script to Dos batch files darwinkna Shell Programming and Scripting 1 05-12-2006 12:01 PM
UNIX Shell script to chec timeout period when collecting files in directory - HELP Danny Fang Shell Programming and Scripting 1 03-23-2006 08:41 PM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 08-28-2008
wingchun22 wingchun22 is offline
Registered User
  
 

Join Date: Aug 2008
Posts: 19
batch shell script to zip individual files in directory - help

help trying to figure out a batch shell script to zip each file in a directory into its own zip file

using this code but it does not work

Quote:
#!/bin/bash
echo "3gptozip converter"
for f in "$@"
do
zip -j "$f.zip" "$f"
done
echo "Finished with 3gptozip converter"
tryed this also

Quote:

#!/bin/bash
echo "3gptozip converter"
if (($# ==0))
then
echo "Usage: 3gptozip [3gp files] ..."
exit
fi
while (($# !=0 ))
do
zip $1.zip $1
shift
done
echo "Finished with 3gptozip converter"
nothing seems to work , just ends without zipping any files

i have over 3000 files i need to zip up individualy

files to be zipped are in this format 123.flv.3gp

hopfully ending up like 123.flv.3gp.zip

is the file structure the problem

running a single zip command from shell seems to work ok

thanks for help in advance
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 03:25 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0