I am trying to sort a file like this (which is a list of subroutine names)
cfn=(1370) __lib_file_MOD_file_open
fn=(1368) __universe_MOD_general_boot
fn=(916) __universe_MOD_general_main
fn=(6142) __grid_var_MOD_get_overlap
...
according to the integer inside parentheses. I first tried the sort command as
sort -t '=' -k 2 routine_list.txt
but then fn=(916) comes at the end of the ouput.
fn=(1368) __universe_MOD_general_boot
cfn=(1370) __lib_file_MOD_file_open
fn=(6142) __grid_var_MOD_get_overlap
...
fn=(916) __universe_MOD_general_main
but I would like the numbers to be sorted in the increasing order (916 -> 1368 -> 1370 -> ...) Is it possible to do this relatively simply by using several commands or options?