I run sed as part of a shell script to clear the bind logs to insert into the database.
One of the sed commands:
sed -i 's/-/:/g' $DPath/named.query.log
This turns out to be problematic, as it interrupts any resource requests that also include dashes (I use: as a delimiter for the awk statement next).
My question is: how to limit the sed command above to only the first ten characters of a string? I have not seen a specific switch that does this, and I'm nowhere good enough for RegEx to even start developing one that works. I cannot just use a regular expression to match previous numbers, because it is possible that the template may be part of a resource request. Hell, I can't even use pattern matching for #### - ## - ## because, again, it can be part of the resource.
Any ideas are greatly appreciated.
Mikeh source share