I'm struggling with automatically renaming a regular download.
Both the folder it gets moved to as well as the filename needs to use "&" instead of "and".
I'm using CentOS Linux and have a filter setup for the download already to trigger a script, I'm just not able to make the script operate as desired.
Any help is appreciated
Script to slightly alter folder/name.
Re: Script to slightly alter folder/name.
If you would post the script and tell what works and what not, maybe others can help.
Re: Script to slightly alter folder/name.
rename -n-v 's/and/&/' *
should work
should work
Re: Script to slightly alter folder/name.
Thanks for the quick response! It looks like that rename command will work real well on the file.exussum wrote:rename -n-v 's/and/&/' *
should work
However, how do I get it moved to the proper folder?
So for example:
Code: Select all
/files/Some and Show/Season 2/Some.and.Show.S02E04.avi
Code: Select all
/files/Some & Show/Season 2/Some.&.Show.S02E04.avi
Or am I over-thinking it, is there an easier way?
Re: Script to slightly alter folder/name.
If
works, how about
So: going three levels deep. I have not tested this, but it looks logical to me.
Code: Select all
rename -n-v 's/and/&/' *
Code: Select all
rename -n-v 's/and/&/' *
rename -n-v 's/and/&/' */*
rename -n-v 's/and/&/' */*/*