mirror of
https://github.com/jarun/nnn.git
synced 2024-11-17 16:39:14 +00:00
Remove -E from sed in plugins
This commit is contained in:
parent
c147414bc7
commit
3be2dd8390
16
plugins/dups
16
plugins/dups
|
@ -28,17 +28,17 @@ printf "\
|
||||||
" > "$tmpfile"
|
" > "$tmpfile"
|
||||||
|
|
||||||
# shellcheck disable=SC2016
|
# shellcheck disable=SC2016
|
||||||
find . -size +0 -type f -printf "%${size_digits}s %p\n" | sort -rn | uniq -w"${size_digits}" -D | sed -E '
|
find . -size +0 -type f -printf "%${size_digits}s %p\n" | sort -rn | uniq -w"${size_digits}" -D | sed -e '
|
||||||
s/^ {,12}([0-9]{,12}) (.*)$/printf "%s %s\\n" "$(md5sum "\2")" "d\1"/
|
s/^ \{0,12\}\([0-9]\{0,12\}\) \(.*\)$/printf "%s %s\\n" "$(md5sum "\2")" "d\1"/
|
||||||
' | tr '\n' '\0' | xargs -0 -n1 sh -c | sort | { uniq -w32 --all-repeated=separate; echo; } | sed -nE '
|
' | tr '\n' '\0' | xargs -0 -n1 sh -c | sort | { uniq -w32 --all-repeated=separate; echo; } | sed -ne '
|
||||||
h
|
h
|
||||||
s/^(.{32}).* d([0-9]*)$/## md5sum: \1 size: \2 bytes/p
|
s/^\(.\{32\}\).* d\([0-9]*\)$/## md5sum: \1 size: \2 bytes/p
|
||||||
g
|
g
|
||||||
|
|
||||||
:loop
|
:loop
|
||||||
N
|
N
|
||||||
/.*\n$/!b loop
|
/.*\n$/!b loop
|
||||||
p' | sed -E 's/^.{32} (.*) d[0-9]*$/\1/' >> "$tmpfile"
|
p' | sed -e 's/^.\{32\} \(.*\) d[0-9]*$/\1/' >> "$tmpfile"
|
||||||
|
|
||||||
"$EDITOR" "$tmpfile"
|
"$EDITOR" "$tmpfile"
|
||||||
|
|
||||||
|
@ -46,7 +46,7 @@ printf "Remove commented files? (yes/no) [default=n]: "
|
||||||
read -r commented
|
read -r commented
|
||||||
|
|
||||||
if [ "$commented" = "y" ]; then
|
if [ "$commented" = "y" ]; then
|
||||||
sedcmd="/^(##|[^#]).*/d; /^$/d; s/^# *(.*)$/\1/"
|
sedcmd="/^##.*/d; /^[^#].*/d; /^$/d; s/^# *\(.*\)$/\1/"
|
||||||
else
|
else
|
||||||
printf "Press any key to exit"
|
printf "Press any key to exit"
|
||||||
read -r _
|
read -r _
|
||||||
|
@ -58,10 +58,10 @@ read -r force
|
||||||
|
|
||||||
if [ "$force" = "f" ]; then
|
if [ "$force" = "f" ]; then
|
||||||
#shellcheck disable=SC2016
|
#shellcheck disable=SC2016
|
||||||
sed -E "$sedcmd" "$tmpfile" | tr '\n' '\0' | xargs -0 -r sh -c 'rm -f "$0" "$@" </dev/tty'
|
sed -e "$sedcmd" "$tmpfile" | tr '\n' '\0' | xargs -0 -r sh -c 'rm -f "$0" "$@" </dev/tty'
|
||||||
else
|
else
|
||||||
#shellcheck disable=SC2016
|
#shellcheck disable=SC2016
|
||||||
sed -E "$sedcmd" "$tmpfile" | tr '\n' '\0' | xargs -0 -r sh -c 'rm -i "$0" "$@" </dev/tty'
|
sed -e "$sedcmd" "$tmpfile" | tr '\n' '\0' | xargs -0 -r sh -c 'rm -i "$0" "$@" </dev/tty'
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm "$tmpfile"
|
rm "$tmpfile"
|
||||||
|
|
|
@ -42,7 +42,7 @@ done
|
||||||
|
|
||||||
app=$(find "$@" -iname '*.desktop' -exec grep '^Name=' {} + \
|
app=$(find "$@" -iname '*.desktop' -exec grep '^Name=' {} + \
|
||||||
| sort -u -t ':' -k 1,1 \
|
| sort -u -t ':' -k 1,1 \
|
||||||
| sed -E 's;.+/(.+desktop):Name=(.+);\2:\1;' \
|
| sed -e 's;..*/\(..*desktop\):Name=\(..*\);\2:\1;' \
|
||||||
| sort -t ':' -k 1,1 \
|
| sort -t ':' -k 1,1 \
|
||||||
| column -t -s ':' -o "$(printf '\t')" \
|
| column -t -s ':' -o "$(printf '\t')" \
|
||||||
| $menu \
|
| $menu \
|
||||||
|
|
Loading…
Reference in a new issue