-
bash scripting?
I am writing a bash script to do some basic database operations. I am not familiar with all of bash scripting's abilities yet. Can I edit specific lines and portions of lines in a file with bash scripting or do I need to use something else? I would do the whole thing in C but I want to use cron to autoupdate the database
-
> I would do the whole thing in C but I want to use cron to autoupdate the database
cron is not limited to only running bash scripts you know...
> Can I edit specific lines and portions of lines in a file with bash scripting
It's pretty much the same problem as in C. If you want to change a text file, you read it in, make some changes, and write it out.
Simple edits can usually be achieved with 'sed'.
For more complicated text manipulations, I usually use Perl.
> or do I need to use something else?
Like I said, it doesn't "need" to be something else just to make it runnable from cron.
As with many tools, there is considerable overlap in the capabilities, so I guess you should start with the ones you feel comfortable using.