Hi !
I am trying to remove doubbled entrys in a textfile only between delimiters.
Like that example but i dont know how to do that with sort or similar.
input:
{
aaa
aaa
}
{
aaa
aaa
}
output:
{
aaa
}
{
aaa
}
i would be pleasured for every help !
Mfg Fugitivus
i have tried nothing, i have read the man page for sort but i didnt find any idea how to do that, same thing on uniq i didnt know if uniq or sort can do that thinks.
I am yust beginning with doing such things in a shell script
Because of that i have posted here to have any evidence what i should look for.
You can refer to O'Reilly books for same too. Hope this helps. Also this forum is one of the best forums/platforms to learn unix, you can always search your queries here in search option and if you have made some code and you have queries, you are always welcome to come and ask your queries. Also you can help people in their queries, by this we can help each other in learning which is the primary motive of this forum. Enjoy learning
The array S stores all encountered strings (where string is $0 i.e. the current line). At the end of the block it is deleted, so each block is separate.
The following stores the previous value in a simple variable S, and will only suppress adjacent duplicate lines.