You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
as a shorthand for running [EXECUTABLE] [MATCH1];[EXECUTABLE] [MATCH2]; ... (single input file to [EXECUTABLE]), and:
find ... -exec [EXECUTABLE] {} +
as a shorthand for [EXECUTABLE] [MATCH1] [MATCH2] ... (multiple input files to [EXECUTABLE]).
The problem is that the latter does not work with NMODL subcommands:
$ find . -name '*.mod' -exec nmodl {} passes --nmodl-ast +
find: -exec: no terminating ";" or "+"
$ find . -name '*.mod' -exec nmodl passes --nmodl-ast {} +
file: File does not exist: passes
Run with --help or --help-all for more information.
$ find . -name '*.mod' -exec nmodl {} + passes --nmodl-ast
find: passes: unknown primary or operator
My guess is that there's an assumption in find that the input files are always the last part of the command, which isn't the case for NMODL. This can be a bit limiting since the two forms (with {} \; and with {} +) are not equivalent if there are any changes to the traversed dir done as a result of running [EXECUTABLE].
This is the case by default for NMODL (writes temp files in ${PWD}/tmp), but which can be circumvented by explicitly specifying --scratch-dir [DIR]. Would be nice not to have to use this workaround though.
The text was updated successfully, but these errors were encountered:
When using
find
, one often uses the syntax:find ... -exec [EXECUTABLE] {} \;
as a shorthand for running
[EXECUTABLE] [MATCH1];[EXECUTABLE] [MATCH2]; ...
(single input file to[EXECUTABLE]
), and:as a shorthand for
[EXECUTABLE] [MATCH1] [MATCH2] ...
(multiple input files to[EXECUTABLE]
).The problem is that the latter does not work with NMODL subcommands:
My guess is that there's an assumption in
find
that the input files are always the last part of the command, which isn't the case for NMODL. This can be a bit limiting since the two forms (with{} \;
and with{} +
) are not equivalent if there are any changes to the traversed dir done as a result of running[EXECUTABLE]
.This is the case by default for NMODL (writes temp files in
${PWD}/tmp
), but which can be circumvented by explicitly specifying--scratch-dir [DIR]
. Would be nice not to have to use this workaround though.The text was updated successfully, but these errors were encountered: