The UNIX and Linux Forums  


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



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

Reply
English Japanese Spanish French German Portuguese Italian Powered by Powered by Google
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 11-27-2009
Registered User
 

Join Date: Aug 2008
Posts: 6
unrar multiple files with password [SOLVED]

The problem: how to unrar multiple rar files with known password

This works fine:
Quote:
#!/bin/sh
for f in "*.part1.rar"; do unrar e "$f"; done
but how to/what to implement to prevent asking me for password each time

Have tried:

Quote:
#!/bin/sh
passwd=KNOWPASS
for f in "*.part1.rar"; do unrar e p$passwd "$f"; done
but it wont work.

Any help appreciated.

Last edited by vampirex; 11-27-2009 at 07:24 AM..
  #2 (permalink)  
Old 11-27-2009
Registered User
 

Join Date: Apr 2009
Location: /usr/bin/vim
Posts: 618
from the man page, it is -p and not p.



Code:
   -ep       Don't create directories while extracting.

       -o+       Overwrite files when extracting.

       -o-       Don't overwrite files when extracting.

       -p        Decrypt archive using a password.

  #3 (permalink)  
Old 11-27-2009
Registered User
 

Join Date: Aug 2008
Posts: 6
Even better:

Quote:
#!/bin/sh
PASS=pass
FILE=file
#
find -type f -name $FILE -exec unrar -p$PASS x {} \;

Last edited by vampirex; 11-27-2009 at 10:48 AM..
Sponsored Links
Reply

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 Off


More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
extract multiple cloumns from multiple files; skip rows and include filenames; awk manishabh Shell Programming and Scripting 4 08-18-2009 11:55 PM
Solaris 10,audio don't work and unrar needed bgf0 SUN Solaris 1 12-10-2008 12:20 PM
Unrar Multiple Files with Command dobbs UNIX for Dummies Questions & Answers 2 09-09-2008 11:10 PM
unrar on MPRAS (UNIX) Mr C UNIX for Dummies Questions & Answers 0 07-21-2008 01:36 AM
file zip,rar,tar,compress,uncompress,unzip,unrar ismael xavier UNIX Desktop for Dummies Questions & Answers 1 04-14-2008 03:30 PM



All times are GMT -4. The time now is 09:19 AM.


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