]> git.phdru.name Git - phdru.name/phdru.name.git/commitdiff
Add scripts to find html files with or w/o templates
authorOleg Broytman <phd@phdru.name>
Sun, 19 Mar 2017 13:53:55 +0000 (16:53 +0300)
committerOleg Broytman <phd@phdru.name>
Sun, 19 Mar 2017 13:53:55 +0000 (16:53 +0300)
find_html_no_tmpl [new file with mode: 0755]
find_html_no_tmpl_helper [new symlink]
find_html_tmpl [new file with mode: 0755]
find_html_tmpl_helper [new file with mode: 0755]

diff --git a/find_html_no_tmpl b/find_html_no_tmpl
new file mode 100755 (executable)
index 0000000..a80902d
--- /dev/null
@@ -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 (symlink)
index 0000000..922e7ca
--- /dev/null
@@ -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 (executable)
index 0000000..c027d9d
--- /dev/null
@@ -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 (executable)
index 0000000..449462f
--- /dev/null
@@ -0,0 +1,2 @@
+#! /bin/sh
+exec test -f "`echo \"$1\" | sed 's/\.html$/.tmpl/'`"