How to sort values that has different position of the fields in bash -
i discovered looking @ logs; commits git may have or not have name , last name; means if sort using -k, position of fields may not correct. for example, if file commits various repository standard format have is commit - name - surname - date - repo name i sort them sort -k 4, them ordered date (that's need)/ problem is, committer name replaced generic name (not sure why, not managing repository); ends jumping 1 field, , date on 3rd position, not 4th. this results in majority of commits ordered correctly, ones has date on 3rd position, end being @ bottom, don't have them ordered chronologically. since cannot control repo throw @ me, there way tell sort, order date, without specify 1 field has date? or should use different sort? can not check number of fields on line? i.e. counting last element instead of first? granted sort may not have sufficient capabilities specify keys end of line, may have resort small awk script find the right sort key based