I have this command
.file.sh | grep PAL
this gives output as
22/04/2024 13:31:55 thsr_tst_yts_PAL_tyu_tys_PAR_myy_tuy
22/04/2024 13:31:58 mno_ote_tdy_ygd_PAL_LON_ydy_trs
22/04/2024 13:31:57 no_ooe_PAL_tiy_ygd_AMR_yng_try
22/04/2024 13:31:58 ntfp_oyp_PAL_mny_uld_SYD_iul_ufu
22/04/2024 13:31:57 trst_usst_PAL_tstt_mut_UK_st_ufuuu
i want to sort it based on timestamp and if time stamp is same for two then i want it to follow the list trend list = [PAR,UK,AMR,SYD,LON]
Final output want like this.
22/04/2024 13:31:55 thsr_tst_yts_PAL_tyu_tys_PAR_myy_tuy
22/04/2024 13:31:57 trst_usst_PAL_tstt_mut_UK_st_ufuuu
22/04/2024 13:31:57 no_ooe_PAL_tiy_ygd_AMR_yng_try
22/04/2024 13:31:58 ntfp_oyp_PAL_mny_uld_SYD_iul_ufu
22/04/2024 13:31:58 mno_ote_tdy_ygd_PAL_LON_ydy_trs
in this if you see time stamp of 13:31:57 is twice therefore from list it should check the regex UK one should list first and then AMR one
Similarly for 13:31:58 as per list SYD should come first and then LON
1