
When you scrap data in HTML , it’s common , depending on the quality of you regex to end up with a string with some useless character at the end (Or the Beginning),
If you string looks like that :
My useful data</a> <
You can use the command head to drop the X last character of your string ,
So in my Case , to Keep only the string My useful data and drop the </a> <
I’m going to pipe my string to
This will delete the last 6 chars of my string , giving the data that i need later in my script
but in some implementation of the head command this will not work ,
you can use an alternative with sed
This will delete the last 4 characters of your line , or alternatively

When you do some bash scripting , this is often useful to get data from webserver because they are a very simple way to exchange data from computer from computer.
Let’s say you need to change you ip address because there was a change on the network and now ip settings changed,