Script help - TAR

CAN'T CHANGE THE TOPIC NAME*** I'm using "zip" instead

Hi. I'm trying to make my script use "zip" and i want it to compress all the files in a directory to individual zip files... but i can't really figure out how. i have googled around. tried some different things... but i can't get it to work. It doesn't do anything after "exit" when i run the script.

And yes the rest of the script works as it should.

script:

#!do not change below
cd $LOCAL
ftp -n $HOST <<SCRIPT
user $USER $PASSWD
prompt
binary
cd $REMOTE
mget -f $FILES
exit
cd $LOCAL
zip *.txt
SCRIPT

Try...

for i in *.txt; do zip "${i%.txt}.zip" "$i"; done

OMG it worked. thx... sorry to ask... how do i remove the txt files it just ziped.

rm *.txt ?

Yes, but careful. That will delete all the txt files in current directory.

Once the zip operation is completed, ( after successful completion ), the below command will delete that .txt file

 
for i in *.txt; do zip "${i%.txt}.zip" "$i" && rm "$i" ; done

OKey. Thanks for all the help with this little issue. and it's now solved ^^

Or use zip -m
From man zip...