LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
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 12-11-2009, 04:37 PM   #1
ExWizzard
LQ Newbie
 
Registered: Aug 2009
Posts: 8

Rep: Reputation: 0
Rename file to parent directory name


Alright , basically im running rtorrent client and i have a task in rtorrent to auto extract any downloaded torrent that is packed in rar.

Code:
system.method.set_key = event.download.finished,unrar_on_completion,"execute=unrar,e,$d.get_base_path=,~/downloads"
As you can see ,
Code:
"execute=unrar,e,$d.get_base_path=,~/downloads"
I can execute shell commands.
Now the problem is that many of the extracted rar files have a badly formatted name which is bad for me. I would like to rename the extracted file to the name of the directory they were extracted from.
So i would execute a script that unrars and then renames.
Is this doable or am i asking too much?
Thanks
 
Old 12-11-2009, 04:54 PM   #2
rweaver
Senior Member
 
Registered: Dec 2008
Location: Louisville, OH
Distribution: Debian, CentOS, Slackware, RHEL, Gentoo
Posts: 1,833

Rep: Reputation: 163Reputation: 163
I'm a little unclear on what you're asking but, it's currently unraring the files and all you need it to do additionally is rename the directory? or is it not functioning presently and you want it to have a different behavior?
 
Old 12-11-2009, 05:19 PM   #3
ExWizzard
LQ Newbie
 
Registered: Aug 2009
Posts: 8

Original Poster
Rep: Reputation: 0
Yes , its currently unraring and i want it to automatically change the name of the unrared file to match the name of the folder the file was in
 
  


Reply

Tags
renamescript


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
inherit permissions of the parent directory in newly created file abhijit_mohanta Linux - Newbie 1 09-10-2009 07:45 PM
File descriptors shared between child and parent causing parent to hang. bharadiaam Linux - Newbie 1 03-02-2009 02:01 AM
Unrar and Rename to Parent Folder Recursively Vasto Linux - Newbie 9 10-16-2008 07:36 AM
Run script on every file contained within a parent directory and its subdirectories General Programming 4 05-15-2006 03:12 AM
mv the contents of one directory to the parent directory warkrime Linux - Newbie 4 07-14-2003 08:03 PM


All times are GMT -5. The time now is 03:11 PM.

Main Menu
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