aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/scripts/lessfilter.sh
diff options
context:
space:
mode:
authorneodarz <neodarz@neodarz.net>2019-09-05 07:48:16 +0200
committerneodarz <neodarz@neodarz.net>2019-09-05 07:48:16 +0200
commit9b19480228d8421c3987a634a602012c953a993e (patch)
tree4bce21766502f3a72bb2002daeea2a406c2a3bda /dotfiles/scripts/lessfilter.sh
parent40dddc15f4a323d3c84c84be7bb2c5ca94d3c07c (diff)
downloaddotfiles_dotdrop-9b19480228d8421c3987a634a602012c953a993e.tar.xz
dotfiles_dotdrop-9b19480228d8421c3987a634a602012c953a993e.zip
Add some scripts
Diffstat (limited to '')
-rwxr-xr-xdotfiles/scripts/lessfilter.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/dotfiles/scripts/lessfilter.sh b/dotfiles/scripts/lessfilter.sh
new file mode 100755
index 0000000..d85c217
--- /dev/null
+++ b/dotfiles/scripts/lessfilter.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+case "$1" in
+ *.awk|*.groff|*.java|*.js|*.m4|*.php|*.pl|*.pm|*.pod|*.sh|\
+ *.ad[asb]|*.asm|*.inc|*.[ch]|*.[ch]pp|*.[ch]xx|*.cc|*.hh|\
+ *.lsp|*.l|*.pas|*.p|*.xml|*.xps|*.xsl|*.axp|*.ppd|*.pov|\
+ *.diff|*.patch|*.py|*.rb|*.sql|*.ebuild|*.eclass)
+ pygmentize -f 256 "$1";;
+ .bashrc|.bash_aliases|.bash_environment)
+ pygmentize -f 256 -l sh "$1"
+ ;;
+ *)
+ grep "#\!/bin/bash" "$1" > /dev/null
+ if [ "$?" -eq "0" ]; then
+ pygmentize -f 256 -l sh "$1"
+ else
+ exit 1
+ fi
+ esac
+
+exit 0