Below is the extract of one file where there are many similar entries.
I want to replace a pattern starting with managed and ending with second .com ( for example "managed_server_lonlx20491.example.com_2_lonlx20491.example.com") with only "managed".
i.e. final output should look like this
Code:
$cat file1
| weblogic | bakejo | user1@example.com | user1@example.com | managed:8380 | managed:8380 |
| weblogic | bakejo | user1@example.com | user1@example.com | lonlx10404.example.com | lonlx20491.example.com |
I tried to use sed
$sed -ne 's/managed_server_*_2_*.com/managed/p' file1
which did not work
. I am sure taht I am not using correct regex. Please help.