From 5bfe6ea88d9f0579f7d4ed471c63c342c7b6fc1b Mon Sep 17 00:00:00 2001 From: Oleg Broytman Date: Sun, 19 Mar 2017 16:53:55 +0300 Subject: [PATCH] Add scripts to find html files with or w/o templates --- find_html_no_tmpl | 10 ++++++++++ find_html_no_tmpl_helper | 1 + find_html_tmpl | 10 ++++++++++ find_html_tmpl_helper | 2 ++ 4 files changed, 23 insertions(+) create mode 100755 find_html_no_tmpl create mode 120000 find_html_no_tmpl_helper create mode 100755 find_html_tmpl create mode 100755 find_html_tmpl_helper diff --git a/find_html_no_tmpl b/find_html_no_tmpl new file mode 100755 index 0000000..a80902d --- /dev/null +++ b/find_html_no_tmpl @@ -0,0 +1,10 @@ +#! /bin/sh + +while getopts d opt; do + case $opt in + d ) del="-delete" ;; + esac +done +shift `expr $OPTIND - 1` + +exec find "${1:-.}" -name '*.html' \! -exec "$0_helper" '{}' \; -print $del diff --git a/find_html_no_tmpl_helper b/find_html_no_tmpl_helper new file mode 120000 index 0000000..922e7ca --- /dev/null +++ b/find_html_no_tmpl_helper @@ -0,0 +1 @@ +find_html_tmpl_helper \ No newline at end of file diff --git a/find_html_tmpl b/find_html_tmpl new file mode 100755 index 0000000..c027d9d --- /dev/null +++ b/find_html_tmpl @@ -0,0 +1,10 @@ +#! /bin/sh + +while getopts d opt; do + case $opt in + d ) del="-delete" ;; + esac +done +shift `expr $OPTIND - 1` + +exec find "${1:-.}" -name '*.html' -exec "$0_helper" '{}' \; -print $del diff --git a/find_html_tmpl_helper b/find_html_tmpl_helper new file mode 100755 index 0000000..449462f --- /dev/null +++ b/find_html_tmpl_helper @@ -0,0 +1,2 @@ +#! /bin/sh +exec test -f "`echo \"$1\" | sed 's/\.html$/.tmpl/'`" -- 2.39.5