I have the issue to extract the x amount of characters from string and i have the difficulty enlarging the capability of the expression.
I have tried to use the sed command.
If i have the string example.com.db i need to keep "example.com",for that i use
sed 's/\.db//g'
How to change expression so that i can use these kind of files too example.db.db.com.db
.
in this case the end result i need is example.db.db.com
Best Answer
you can use:
alternatively you can use:
to remove the last 3 characters and
to remove the everything after the last dot