Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Tue 02 Sep 2014, 05:25
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Need script to extract rar, zip and 7z files
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [4 Posts]  
Author Message
enhu


Joined: 26 May 2009
Posts: 301

PostPosted: Wed 08 Sep 2010, 07:35    Post subject:  Need script to extract rar, zip and 7z files  

can you help me with this please. tryingto create a script that will extract rar. zip and 7z files after it is downloaded to a particular folder.

something like this but not sure if it will work Very Happy


Code:

if [ -e *.rar *.zip *.7z ]
then
   unrar x *.rar /path/%d
fi
Back to top
View user's profile Send private message Visit poster's website 
vovchik


Joined: 23 Oct 2006
Posts: 1285
Location: Ukraine

PostPosted: Wed 08 Sep 2010, 11:00    Post subject:  

Dear enhu,

Good information here http://www.debianadmin.com/howto-crack-rar-7z-and-zip-files-in-linux.html.

Quote:
If you want to unrar a list of files, you could use this command. You don’t necessarily need the quotes, but it helps when the filenames have spaces or something like that in them.

for f in *.rar;do unrar e “$f”;done

If you wanted to use 7zip to extract a list of files:

for f in *.001;do 7z e “$f”;done

Or if you wanted to unzip a list of files:

for f in *.zip;do unzip “$f”;done

You could even chain commands together if you wanted to. For instance, if all your zip files contained .txt files and you wanted to unzip them and then move the unzipped files to another directory:

for f in *.zip;do unzip “$f”;done; for f in *.txt;do mv “$f” /myfolder/;done

The bash shell is just so incredibly powerful… this doesn’t even tap the power, but it should give you a good idea of what is possible.


With kind regards,
vovchik
Back to top
View user's profile Send private message 
abushcrafter


Joined: 30 Oct 2009
Posts: 1447
Location: England

PostPosted: Fri 12 Nov 2010, 08:14    Post subject:  

You might love this: http://www.murga-linux.com/puppy/viewtopic.php?p=432627#432627
_________________
adobe flash is rubbish!
My Quote:"Humans are stupid, though some are clever but stupid." http://www.dependent.de/media/audio/mp3/System_Syn_Heres_to_You.zip http://www.systemsyn.com/
Back to top
View user's profile Send private message Visit poster's website 
jyore


Joined: 06 Nov 2010
Posts: 43

PostPosted: Sat 13 Nov 2010, 20:59    Post subject:  

You could look into python as well. I've used it to automagically extract, replace/edit files, rearchive, and also recalculate the md5. Should be plenty of info on the google, and/or the python website. Should require only a few libraries, most of which, are likely standard python libraries.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0575s ][ Queries: 12 (0.0165s) ][ GZIP on ]