Hi,

at the moment I am reviewing the shell scrips in the darktable source, mainly by employing the shellcheck tool. In this way, I found some minor (manly stylistic) issues.

So far I found only one more serious issue in the statement

if [ -n  "`echo -e $NEW_VERSION | grep  Format`" ]; then

in the file tools/create_version_c.sh. The problem is that POSIX compliant implementations of the build in echo shell function do not support options. Thus

echo -e $NEW_VERSION

will print out literally »-e« plus the content of the variable $NEW_VERSION (with the usual parameter expansion rules applied) in some shells (the dash, for example, which is the default on Debian derivatives). This, however, might not be intended here. Some implementations of echo (the bash build in, for example) allow to specify the option -e to enable the interpretation of backslash escapes.

Thus, I wonder do we really need to enable the interpretation of backslash escapes here? If yes echo should be replaced by /bin/echo, otherwise »-e« is probably wrong here. Probably the line

if [ -n  "`echo -e $NEW_VERSION | grep  Format`" ]; then

should be replaced by

if echo "$NEW_VERSION" | grep -q Format; then

but I am not sure.


        Heiko

--
-- Number Crunch Blog @ https://www.numbercrunch.de
--  Cluster Computing @ http://www.clustercomputing.de
--       Professional @ https://www.mpi-hd.mpg.de/personalhomes/bauke
--  Social Networking @ https://www.researchgate.net/profile/Heiko_Bauke
___________________________________________________________________________
darktable developer mailing list
to unsubscribe send a mail to darktable-dev+unsubscr...@lists.darktable.org

Reply via email to