Artificial intelligent assistant

Highlight every number that is smaller than all previous numbers in the last column Input: network-snapshot-000000 time 6m 40s fid50k_full 34.9546 network-snapshot-000201 time 6m 52s fid50k_full 30.8073 network-snapshot-000403 time 6m 51s fid50k_full 33.3470 network-snapshot-000604 time 6m 51s fid50k_full 32.7172 network-snapshot-000806 time 6m 49s fid50k_full 30.3764 Output: network-snapshot-000000 time 6m 40s fid50k_full 34.9546 network-snapshot-000201 time 6m 52s fid50k_full 30.8073* network-snapshot-000403 time 6m 51s fid50k_full 33.3470 network-snapshot-000604 time 6m 51s fid50k_full 32.7172 network-snapshot-000806 time 6m 49s fid50k_full 30.3764*

$ awk 'NR == 1 { min = $NF } ($NF < min) { min = $NF; $0 = $0 "*" }; 1' file
network-snapshot-000000 time 6m 40s fid50k_full 34.9546
network-snapshot-000201 time 6m 52s fid50k_full 30.8073*
network-snapshot-000403 time 6m 51s fid50k_full 33.3470
network-snapshot-000604 time 6m 51s fid50k_full 32.7172
network-snapshot-000806 time 6m 49s fid50k_full 30.3764*


This initializes the smallest found value, `min`, to the first value in the last column if we're currently reading the first line (`NR == 1`). Then, for each input line, if the value in the last column is strictly smaller than our `min` value, the `min` value is replaced and the current line gets a `*` appended.

Every line is then unconditionally outputted.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 08d33209f197a50b3e40310b9b0cb7b2