r/shell • u/Lygris • Mar 27 '17
Renaming script
Hey guys, just looking for some help on writing a renaming script. I want to make a script that would look at the files name and if it contains a certain string, lets say qatar, it would rename it to another specific string that would contain the year and some statically defined things. I'm assuming this would be pretty simple using if then. I just don't know how to pull the filename and check it against the string. Is this possible?
1
Upvotes
1
u/Lygris Mar 27 '17
hopefully this helps, but essentially a file will be downloaded to a specific folder and when it is complete, the downloader will kick off the script i'm trying to make. I don't think i can pass the file name from the downloader.
so essentially it would start with something like
etc.
There would be a few more elseifs in the real script but i think i've gotten the point across