В письме от воскресенье, 6 января 2019 г. 17:50:36 MSK пользователь Andrew 
Dunstan написал:

> > The correct way to code this is to depend on the exit code,
> > not the text output:
> > 
> > if command -v etags >/dev/null
> > then
> >   : ok
> > else
> >   echo etags not found
> >   exit 1
> > fi
> 
> more succinctly,
>     command -v etags >/dev/null || { echo etags not found; exit 1;}

If it is good enough for you, then is is good for me for sure...
Imported it to the patch.

diff --git a/.gitignore b/.gitignore
index 794e35b..2dfbbe1 100644
diff --git a/src/tools/make_ctags b/src/tools/make_ctags
index 1609c07..1e71692 100755
--- a/src/tools/make_ctags
+++ b/src/tools/make_ctags
@@ -2,6 +2,9 @@
 
 # src/tools/make_ctags
 
+command -v ctags >/dev/null || \
+	{ echo "'ctags' utility is not found" 1>&2; exit 1;}
+
 trap "rm -f /tmp/$$" 0 1 2 3 15
 rm -f ./tags
 
diff --git a/src/tools/make_etags b/src/tools/make_etags
index 3ce96bc..6dc6710 100755
--- a/src/tools/make_etags
+++ b/src/tools/make_etags
@@ -2,6 +2,9 @@
 
 # src/tools/make_etags
 
+command -v etags >/dev/null || \
+	{ echo "'etags' utility is not found" 1>&2; exit 1;}
+
 rm -f ./TAGS
 
 find `pwd`/ -type f -name '*.[chyl]' -print |

Reply via email to