mirror of
https://github.com/jarun/nnn.git
synced 2024-11-01 00:47:18 +00:00
16 lines
382 B
Bash
Executable file
16 lines
382 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
|
|
|
|
# shellcheck disable=SC1090,SC1091
|
|
. "$(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"
|