nnn/plugins/mimelist
Arun Prakash Jana a7fd4957dd
shellcheck fixes
2020-11-22 20:30:52 +05:30

15 lines
347 B
Bash
Executable file

#!/usr/bin/env sh
# Description: Find and list files by mime type in smart context
#
# Shell: POSIX compliant
# Author: Arun Prakash Jana
. "$(dirname "$0")"/.nnn-plugin-helper
printf "mime (e.g., video/audio/image): "
read -r mime
printf "%s" "+l" > "$NNN_PIPE"
find . | file -if- | grep "$mime" | awk -F: '{printf "%s\0", $1}' > "$NNN_PIPE"