tadd vegetarian search script - recipes - various cooking recipes
(HTM) git clone git://src.adamsgaard.dk/recipes
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Submodules
---
(DIR) commit 02da4e7c2156041d056fc26f91594233c4e63adc
(DIR) parent 2162667ed0e2e4a2ef5dfd4f84619865b6ec9410
(HTM) Author: Anders Damsgaard <anders@adamsgaard.dk>
Date: Thu, 26 Aug 2021 21:30:30 +0200
add vegetarian search script
Diffstat:
A cookwhatveg | 10 ++++++++++
1 file changed, 10 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/cookwhatveg b/cookwhatveg
t@@ -0,0 +1,10 @@
+#!/bin/sh
+# Pass a series of ingredients as arguments to this script, and it
+# will print all files that contain them.
+cmd="find . -iname '*.md' -type f"
+i=0
+for a in "$@"; do
+ i=$((i + 1))
+ cmd="${cmd} -exec grep -qiE '^- .*${a}' {} \;"
+done
+eval "$cmd -exec grep -iLE '(meat|pork|beef|chicken|fish|tuna|salmon|duck|shrimp)' {} \; | sed 's,^./,,'"