summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-30 00:50:16 +0100
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-10-30 00:50:16 +0100
commit15bc38edec39279f26969ca4b67126f6e544b831 (patch)
treec500f84a07c04acce18035b7635e93a2f710f162 /bin
parent0e5e622952fe51588f1537e621c63cbe4a91c136 (diff)
checkpoint
Diffstat (limited to 'bin')
-rwxr-xr-xbin/extra/gdbcore8
-rwxr-xr-xbin/extra/notes_index4
2 files changed, 6 insertions, 6 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"
diff --git a/bin/extra/notes_index b/bin/extra/notes_index
index da5c6cf..28942cb 100755
--- a/bin/extra/notes_index
+++ b/bin/extra/notes_index
@@ -21,7 +21,7 @@ do
-name 'index.md' \
-printf '%f ' \
-exec grep '^# ' -m1 {} \; |
- sed 's/\(.\+\.md\) # \(.\+\)/- [\2](\1)/' |
+ sed 's/\(.\+\.md\) # \(.\+\)/- [\2][\1]/' |
sort -t '[' -k 2 -n >> index.md
if [ "$(find . -mindepth 2 -maxdepth 2 -type f -name '*.md' | wc -l)" -gt 0 ]
@@ -32,7 +32,7 @@ do
-maxdepth 1 \
-type d \
-not -name '.*'\
- -printf '- [%f](%f/index.md)\n' |
+ -printf '- [%f][%f/index.md]\n' |
sort -t '[' -k 2 >> index.md
fi