Browse Source

first commit

master
jul 1 year ago
commit
c870a5110c
  1. 4
      README.md
  2. 24
      shlr

4
README.md

@ -0,0 +1,4 @@
shlr - grep and preview shlogs
forked from /home/hannu/bin/shlr
@hannu : thanks for fzf preview trick

24
shlr

@ -0,0 +1,24 @@
#!/bin/sh
# shlr - grep and preview shlogs
# forked from /home/hannu/bin/shlr
# @hannu : thanks for fzf preview trick
LESS="-cK"
if [ $1 ]
then
grep --directories=skip --files-with-matches --null "$@" /home/*/.shlog/* \
| xargs --null --no-run-if-empty stat -c "%y %n" \
| sort -r \
| cut -d ' ' -f4- \
| fzf \
--preview 'head -100 {}' \
--preview-window=down:80%:wrap \
--bind "enter:execute(${PAGER:-less} {})"
else
ls -t /home/*/.shlog/* | fzf \
--preview 'head -100 {}' \
--preview-window=down:80%:wrap \
--bind "enter:execute(${PAGER:-less} {})"
fi
Loading…
Cancel
Save