Thanks, I have another problem concerning the at command:
I want to list the current at queue ordered by start time.
The atq command results in this hard to read output:So I have written a small utility atshow to fix this:The output now becomes:This works mostly, but on a month break like from March to April it screws up the sequence putting Apr before Mar...
So how can I add a command to change the 3-letter month names to 2-digit month numbers 01..12?
I assume it would be something to put before the sort item in my script command...
Like:
I want to list the current at queue ordered by start time.
The atq command results in this hard to read output:
Code:
$ atq1426 Mon Feb 12 01:00:00 2024 a bosse1427 Mon Feb 12 03:00:00 2024 a bosse1417 Sun Feb 11 14:00:00 2024 a bosse1420 Sun Feb 11 18:02:00 2024 a bosse1423 Sun Feb 11 22:00:00 2024 a bosse1418 Sun Feb 11 16:00:00 2024 a bosse1419 Sun Feb 11 16:02:00 2024 a bosse1428 Mon Feb 12 05:00:00 2024 a bosse1415 Mon Feb 12 04:45:00 2024 a bosse1416 Sun Feb 11 12:00:00 2024 a bosse1425 Mon Feb 12 00:00:00 2024 a bosse1422 Sun Feb 11 19:00:00 2024 a bosse1424 Sun Feb 11 23:00:00 2024 a bosse1421 Sun Feb 11 18:00:00 2024 a bosse
Code:
#!/bin/bashatq | awk '{print $6 " " $3 " " $4 " " $5 " " $1}' | sort
Code:
$ atshow2024 Feb 11 12:00:00 14162024 Feb 11 14:00:00 14172024 Feb 11 16:00:00 14182024 Feb 11 16:02:00 14192024 Feb 11 18:00:00 14212024 Feb 11 18:02:00 14202024 Feb 11 19:00:00 14222024 Feb 11 22:00:00 14232024 Feb 11 23:00:00 14242024 Feb 12 00:00:00 14252024 Feb 12 01:00:00 14262024 Feb 12 03:00:00 14272024 Feb 12 04:45:00 14152024 Feb 12 05:00:00 1428
So how can I add a command to change the 3-letter month names to 2-digit month numbers 01..12?
I assume it would be something to put before the sort item in my script command...
Like:
Code:
#!/bin/bashatq | awk '{print $6 " " $3 " " $4 " " $5 " " $1}' | namereplace | sort
Statistics: Posted by Bosse_B — Sun Feb 11, 2024 8:39 am