lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Thomas Koch (JIRA)" <j...@apache.org>
Subject [jira] Created: (SOLR-2260) syntax error in shell script "abo"
Date Wed, 01 Dec 2010 14:15:12 GMT
syntax error in shell script "abo"
----------------------------------

                 Key: SOLR-2260
                 URL: https://issues.apache.org/jira/browse/SOLR-2260
             Project: Solr
          Issue Type: Sub-task
    Affects Versions: 1.4.1, 1.4
            Reporter: Thomas Koch


The syntax error doesn't effects all shells, on my computer only zsh but not dash or bash:
--- src/scripts/abo
+++ src/scripts/abo
@@ -175,7 +175,7 @@ trap 'echo cleaning up, please wait ...;/bin/rm -rf ${data_dir}/${name}
${data_d
 
 # make a backup using hard links into temporary location
 # then move it into place atomically
-if [[ "${OS}" == "SunOS" || "${OS}" == "Darwin"  || "${OS}" == "FreeBSD"]]
+if [[ "${OS}" == "SunOS" || "${OS}" == "Darwin"  || "${OS}" == "FreeBSD" ]]
 then
   orig_dir=$(pwd)
   mkdir ${data_dir}/${temp}

It's only the space at the end of the if statement. You can check for syntax errors in shells
with
sh -n $PATH_TO_SCRIPT
Debian is doing this as part of it's package sanity checks. This is how I found the issue.
If you have multiple shells on your system, you can run this check with all shells:
zsh -n $PATH_TO_SCRIPT
dash -n $PATH_TO_SCRIPT
bash -n $PATH_TO_SCRIPT

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message