LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices



Reply
 
Search this Thread
Old 05-29-2008, 10:55 PM   #1
infonlinebr
LQ Newbie
 
Registered: May 2008
Posts: 20

Rep: Reputation: 0
Extract all archives in rar


I'm trying to extract multiple. Rar which is in a folder using the command

Code:
"rar x *.rar"
and he always answered as

Code:
[mario]$ rar x *.rar
RAR 3.30    Copyright (c) 1993-2004 Eugene Roshal    22 Jan 2004
Shareware version         Type RAR -? for help
Extracting from 001-archive.rar
No files to extract
and when I file by file with "rar x 001-archive.rar" operates normally
 
Old 05-29-2008, 11:45 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 331Reputation: 331Reputation: 331Reputation: 331
Looks like a bug in the rar command line parser. I think the first thing that I would do is type
Code:
rar -?
It might present helpful information.
 
Old 05-30-2008, 12:10 AM   #3
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,049

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Quote:
Originally Posted by stress_junkie View Post
Looks like a bug in the rar command line parser. I think the first thing that I would do is type
Code:
rar -?
It might present helpful information.
Here you can read about the issue:

http://forums.gentoo.org/viewtopic-t...wildcards.html

I always use a for loop on those cases, something like

Code:
for file in *.rar; do unrar x "$file"; done
 
Old 05-30-2008, 12:15 AM   #4
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Why would you expect different behavior? 'rar' is behaving as documented in the manual.
You can do:

for X in $(ls *.rar); do rar x $X; done
 
Old 05-30-2008, 12:21 AM   #5
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,049

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
Quote:
Originally Posted by pinniped View Post
Why would you expect different behavior? 'rar' is behaving as documented in the manual.
You can do:

for X in $(ls *.rar); do rar x $X; done
I don't know what the issue is, and I really don't feel like investigating it because that's what for loops are for, anyway.

I can tell you for sure that the wildcard expansion is done at shell level, *before* rar or unrar gets into scene, so that shouldn't be a problem.

Also, I don't want to sound pedant, but I would change your for loop a bit. ls is completely unnecesary, and you should *always* quote filenames unless you are really certain that they will contain no blank spaces or the like.

Code:
for X in *.rar; do rar x "$X"; done
 
Old 05-30-2008, 07:52 AM   #6
infonlinebr
LQ Newbie
 
Registered: May 2008
Posts: 20

Original Poster
Rep: Reputation: 0
It must be some permission of SSH same as those servers use a "shared" must be with something missing, but interesting this business loop, vai and help now.
Very Thanks!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
shellscript to extract multiple archives quackyo Programming 13 04-27-2009 06:39 AM
.rar extract Muhammed Linux - Software 2 08-12-2007 07:25 AM
LXer: Handling RAR and 7-Zip archives in Linux LXer Syndicated Linux News 0 02-02-2007 08:21 AM
Extracting multi-part RAR archives? Kixdemp Linux - Software 2 03-22-2006 06:44 PM
extracting files from RAR archives corbis_demon Linux - Newbie 3 03-30-2005 06:25 AM


All times are GMT -5. The time now is 11:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration