sistema_progs

Programas para customizar o meu entorno de traballo nos meus equipos persoais
Log | Files | Refs

mimelist (382B)


      1 #!/usr/bin/env sh
      2 
      3 # Description: Find and list files by mime type in smart context
      4 #
      5 # Shell: POSIX compliant
      6 # Author: Arun Prakash Jana
      7 
      8 # shellcheck disable=SC1090,SC1091
      9 . "$(dirname "$0")"/.nnn-plugin-helper
     10 
     11 printf "mime (e.g., video/audio/image): "
     12 read -r mime
     13 
     14 printf "%s" "+l" > "$NNN_PIPE"
     15 find . | file -if- | grep "$mime" | awk -F: '{printf "%s\0", $1}' > "$NNN_PIPE"