tadd vegetarian search script - recipes - various cooking recipes | |
git clone git://src.adamsgaard.dk/recipes | |
Log | |
Files | |
Refs | |
Submodules | |
--- | |
commit 02da4e7c2156041d056fc26f91594233c4e63adc | |
parent 2162667ed0e2e4a2ef5dfd4f84619865b6ec9410 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Thu, 26 Aug 2021 21:30:30 +0200 | |
add vegetarian search script | |
Diffstat: | |
A cookwhatveg | 10 ++++++++++ | |
1 file changed, 10 insertions(+), 0 deletions(-) | |
--- | |
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|shri… |