You could do it with a series of sed commands. There's probably a simpler way of doing it thought. Maybe with the date command.I just tested something that uses date to manipulate the date. You can then display the date in any form you wish. This bash script just changes the date format, rearranges the field order a bit and sorts on date.
You could of course rearrange the output again after the sort.
Code:
atq | sed "s/Jan/01/;s/Feb/02/;s/Mar/03/s;Apr/04/;" # and so on
You could of course rearrange the output again after the sort.
Code:
#!/bin/bash# Display at queue it sorted formatatq | while read id day dom month time year detailsdo date "+%Y-%m-%d %H:%M:%S $id $details" -d "$day $dom $month $time $year"done | sort
Statistics: Posted by rpdom — Sun Feb 11, 2024 9:44 am