diff options
author | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-10-30 00:50:16 +0100 |
---|---|---|
committer | Raymaekers Luca <raymaekers.luca@gmail.com> | 2024-10-30 00:50:16 +0100 |
commit | 15bc38edec39279f26969ca4b67126f6e544b831 (patch) | |
tree | c500f84a07c04acce18035b7635e93a2f710f162 /bin/extra/gdbcore | |
parent | 0e5e622952fe51588f1537e621c63cbe4a91c136 (diff) |
checkpoint
Diffstat (limited to 'bin/extra/gdbcore')
-rwxr-xr-x | bin/extra/gdbcore | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bin/extra/gdbcore b/bin/extra/gdbcore index 3364ce8..69b1a64 100755 --- a/bin/extra/gdbcore +++ b/bin/extra/gdbcore @@ -23,10 +23,10 @@ coredir=/var/lib/systemd/coredump # Temporary file listing core files location, later used as location for the corefile tmp="$(mktemp)" + if [ "$2" = "-r" ]; then - recent="$(find "$coredir" -name 'core.assert*' -printf '%Ts %f\n' | - sort -n | - head -n 1 | + recent="$(find "$coredir" -name "core.${prog##*/}*" -printf '%Ts %f\n' | + sort -n -r | head -n 1 | cut -f 2- -d' ')" corefile="$coredir"/"$recent" else @@ -39,7 +39,7 @@ else -e 's/\.[0-9]\+\.[0-9a-f]\+\.[0-9]\+\.[0-9]\+\.zst / /' \ "$tmp" | awk '{print NR ".", "[" $3,$2"]", $1}' | - sort -k 2 -k 3 -r | + sort -r -k 3 -k 2 | fzf -0 --with-nth=2..)" if [ -z "$choice" ]; then rm "$tmp" |