So I want to rename a bunch of files that I have. They all have a bunch of numbers in the middle of the file that I want to remove. I know that I can use a combination of for looping in bash with regular expressions to do this. However, I'm bad at bash. I've written little scripts before, but they take me much longer than they should. I've gone through some regex tutorials, and some bash tutorials, but neither say "this is how you get the files in pwd and process them" very clearly. I end up with whitespace issues and not being able to read stuff and all kinds of problems that I really don't like.
I want to get to a point where I can just boot up terminal (running mac OS X), spend a minute figuring out what the for loop should be and then just write and execute it. I'm at that point with many other programming languages, but for some reason bash eludes me.
Can anyone recommend a good tutorial for me to work my way through that will get me to the aforementioned level?
I've gone through a lot of this tutorial and most of this one as well as many hours googling, but I can't seem to find one that explains everything I need to know.
TLDR I need a good, practical bash tutorial for batch file processing.
Bash Programming to batch rename
Page 1 of 16 Replies - 2600 Views - Last Post: 19 January 2012 - 09:31 AM
Replies To: Bash Programming to batch rename
#3
Re: Bash Programming to batch rename
Posted 11 January 2012 - 01:39 AM
mv can rename the files, and if you've really went into regex you'd have a far easier time figuring this out.
http://linux.die.net...de/chap_04.html
http://linux.die.net...de/chap_04.html
#4
Re: Bash Programming to batch rename
Posted 11 January 2012 - 01:51 AM
#5
Re: Bash Programming to batch rename
Posted 13 January 2012 - 03:58 PM
Thanks for the two responses, but the file renaming is just a side issue. I want to be able to program in bash better. I want to be able to batch process files using regex and for loops. Do either of you know any good bash or regex (or ideally a combination of both) that could get me to this level?
#6
Re: Bash Programming to batch rename
Posted 13 January 2012 - 04:00 PM
Thanks for the two responses, but the file renaming is just a side issue. I want to be able to program in bash better. I want to be able to batch process files using regex and for loops. Do either of you know any good bash or regex (or ideally a combination of both) that could get me to this level?
#7
Re: Bash Programming to batch rename
Posted 19 January 2012 - 09:31 AM
A good place to start: http://www.dreaminco...bash-resources/
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote







|