I am trying to sort a list of names followed by another string such as:
John Doe
AVAIL
Sara Doe
CALL
Jim Doe
AVAIL
I am trying to sort th
Not sure if it's going to work for you but with some limitations here is a line that kind of doing what you need.
awk '{if ((NR%2-1)==0) {line=sprintf("%-30s",$0)} else {print line ":" $0}}' | \
sort --key=1,30 | tr ':' '\n'
Assumptions: There are no blank lines in between records, name is always less than 30 characters and there is no : used in text.
I am sure you can figure how to change it if assumptions are different.
In a nutshell it, merges two lines using ':' as separator, pads first line to 30 characters and sorts using first 30 characters. Then it breaks lines back.