From 4c66a9c553bcaf9a55683c5a9c2ee6c2b80597f3 Mon Sep 17 00:00:00 2001 From: home Date: Sat, 25 Nov 2023 23:24:09 +0300 Subject: [PATCH] find_ext : fix for hidden files. --- .README.md | 8 +++++++- .config/bash/module/find.sh | 6 +++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.README.md b/.README.md index 0e94bb7..7eb1eb5 100644 --- a/.README.md +++ b/.README.md @@ -486,12 +486,18 @@ Command|Description ---|--- `ffmpeg_mux_audio `|Mux external audio into one container with video (replaces original audio). Run inside dir with original video. names should be the same for each video. -## Files. +## File. Command|Description ---|--- `o `|Open file with the default GUI app. +## Find. + +Command|Description +---|--- +`find_ext`|Find all file extensions recursively. + ## Fix. Contains simple fixes for various issues. diff --git a/.config/bash/module/find.sh b/.config/bash/module/find.sh index a4fd6cb..6f30ba3 100644 --- a/.config/bash/module/find.sh +++ b/.config/bash/module/find.sh @@ -1,7 +1,7 @@ -# Find all file types recursively. -find_types() +# Find all file extensions. +find_ext() { - local types=($(find -type f | sed "s/.*\.//")) + local types=($(find -type f | sed -e "s/.*\///" -e "s/^\.//" -e "/\./!d" -e "s/.*\.//")) echo "${types[@]}" | tr ' ' '\n' | sort -u | tr '\n' ' ' echo }