There are several do nothing solutions in a shell. Most notably :
, a POSIX required null utility.
But you also require that it is an external file.
So: the POSIX standard specified dummy executable files that do nothing could be:
- Utilities that output nothing and their exit status is success (0) (except were noted) (in order of relevance (IMO):
printf '' # requires a format. The format may be empty.
test 1 # requires a non-empty string (or number).
[ 1 ] # equivalent to test.
true # requires no argument.
false # requires no argument (exit code IS 1 ).
rm -f '' # DO NOT USE. requires a file name and will remove it.
sh -c '' # may load init files into memory, not a clean solution.
# but it is almost unheard of that `sh` is missing.
# sh -c '' /path/to/file will not damage the file.
- Utilities that also end on an exit code of
0
but have some output:
echo ''
date +''
expr ''
There may be others ?. search yourself list of executables
But your query also specify (If I understand you correctly) that the called executable is compatible with:
> the actual invocation done by the build system is $EDITOR /path/to/file
That seem to imply that the executable should not use any argument, or, accept one argument and do nothing to it.
I do not know the exact details of your build system, but probably a:
test /path/to/file
Given that EDITOR
is set to test
should work perfectly fine (or true, or false).
If some output is not a problem (the build system discard the output of the EDITOR
), then echo
or printf
may be suitable also.
unset EDITOR
orEDITOR=""
instead?ed
or some other silly default.ed
orvi
perhaps. E.g. less's man page says it takes the editor from "environment variable VISUAL if defined, or EDITOR if VISUAL is not defined, or defaults to "vi" if neither VISUAL nor EDITOR is defined." (Except in Debian it might default to/usr/bin/editor
or such.) I think I've also seen shell scripts with${VISUAL:-${EDITOR:-vi}}
or similar. But seldom anything that would just forgo all editing for users that haven't setEDITOR
in their startup files.