0
I want to do some line manipulation but am stuck in the line by line processing. My file looks like this:
10.10.10.10 ABtest
10.10.10.11 ABprod
I want to append a string at each line according to the string at the end of the line.
My aproach is using awk for testing against the string ABtest
at the end of the line and then to convert from ABtest
to test
with sed. After that, I want to append the output to each related line.
I want to output as follows:
10.10.10.10 ABtest test
10.10.10.11 ABprod prod
With GNU sed:
sed -E 's/(....)$/& \1/' file
– Cyrus – 2019-05-25T17:57:51.083