I'm trying to create a script to append oracleserver to /etc/hosts as an alias of localhost. Which means I need to:
- Locate the line that
^127.0.0.1
and NOToracleserver$
- Then, append
oracleserver
to this line
I know the best practice is probably using negative look ahead. However, sed does not have look around feature: What's wrong with my lookahead regex in GNU sed?. Can anyone provide me some possible solutions?