linux - GNU sort - What is the default algorithm used for comparison? -


i need understanding default algorithm gnu's sort. assumed did lexicographic sort, found out behavior not correspond that, example take following strings:

alex. alex.a alex.z alexa alex0 alexz alex.~ alex alex.| alex.} alex.abc 

and sort them on shell using sort echo 'stuff' | sort

this result get:

alex alex. alex.~ alex.| alex.} alex0 alexa alex.a alex.abc alexz alex.z 

and can't figure out why alex0 , alexa appear in between alex.} , alex.a

can explain me?

sorting , large depends on locale settings:

$ sort sort  alex alex. alex.~ alex.| alex.} alex0 alexa alex.a alex.abc alexz alex.z $ lc_all=c sort sort alex alex. alex.z alex.a alex.abc alex.| alex.} alex.~ alex0 alexz alexa 

Comments

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -