[Linux] Rename downloads as NZB
Posted: September 10th, 2010, 8:12 am
Hello,
I just wrote this simple script to cover my simple needs. What I would like is that the files I download are renamed as the NZB I download. Sabnzbd already puts these downloaded files in a directory named after the NZB.
Currently the situation is like this:
Movies/NZBnameinqueu/a.mkv
b.nfo
c.srt
I would like it to become this:
Movies/NZBnameinqueu/NZBnameinqueu.mkv
NZBnameinqueu.nfo
NZBnameinqueu.srt
Please bear with me as this is the first code I ever wrote (probably cannot get any simpler
). Can the experts tell me if it will do what I would like it to do?
Thanks!
I just wrote this simple script to cover my simple needs. What I would like is that the files I download are renamed as the NZB I download. Sabnzbd already puts these downloaded files in a directory named after the NZB.
Currently the situation is like this:
Movies/NZBnameinqueu/a.mkv
b.nfo
c.srt
I would like it to become this:
Movies/NZBnameinqueu/NZBnameinqueu.mkv
NZBnameinqueu.nfo
NZBnameinqueu.srt
Please bear with me as this is the first code I ever wrote (probably cannot get any simpler

Code: Select all
#!/bin/bash
fullpath=$1
filename=$3
cd $fullpath
mv $* filename