I have a file in which I need to convert the lines. From
<id>ABC</id>
<guid isPermaLink="false">ABC</guid>
need to get the following:
<id>ABC123</id>
<guid isPermaLink="false">ABC123</guid>
i.e., add text before </id>
or </guid>
.
The problem is that I cannot make this case insensitive and cross-platform; for BSD and GNU. As far as I understand, sed
and awk
are not very suitable for this purpose because of the difference between the BSD and GNU versions.
At this point I'm kind of stumped and don't know how to do such a fairly simple operation. Maybe someone can suggest the best way to solve it? Maybe it is possible to do this using only the shell's functions?
Thx