My build of nnn with minor changes
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

28 wiersze
808 B

  1. #!/usr/bin/env sh
  2. # Description: View an image or images in a directory in pager
  3. #
  4. # Note: While it's very easy to fix this in Bash (sample commented), with the
  5. # current POSIX shell script implementation the unmatched patterns are spewed.
  6. # A patch to fix this is highly appreciated.
  7. #
  8. # Shell: POSIX compliant
  9. # Author: Arun Prakash Jana
  10. if ! [ -z "$1" ]; then
  11. if [ -d "$1" ]; then
  12. cd "$1"
  13. # Bash implementation
  14. # shopt -s nullglob
  15. # viu -n *.bmp *.BMP *.gif *.GIF *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.svg *.SVG 2>/dev/null | less -R
  16. for file in *.bmp *.BMP *.gif *.GIF *.jpg *.JPG *.jpeg *.JPEG *.png *.PNG *.svg *.SVG
  17. do
  18. viu -n "$file" 2>/dev/null
  19. done | less -R
  20. else
  21. viu -n "$1" | less -R
  22. fi
  23. fi