text: user14388: I've just dowloaded entrez direct on my Mac and I was trying to perform some simple queries like:
  esearch -db pubmed -query "tn3 transposition immunity" | efetch -format medline
  
  but I keep getting this error
  curl: (22) The requested URL returned error: 400 Bad Request
   ERROR:  curl command failed ( Mar 19 Ott 2021 13:02:26 CEST ) with: 22 
  https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi -d db=pubmed&id=Unable%2Cto%2Clocate%2Cxtract%2Cexecutable.%2CPlease%2Cexecute%2Cthe%2Cfollowing%2Cnquire%2Cdwn%2Cftp.ncbi.nlm.nih.gov%2Centrez%2Centrezdirect%2Cxtract.Darwin.gz%2Cgunzip%2Cf%2Cxtract.Darwin.gz%2Cchmod%2Cx%2Cxtract.Darwin&rettype=medline&retmode=text&tool=edirect&edirect=16.1&edirect_os=Darwin&email=mariocatalano%40MBP-di-Mario.lan"
  
  I'm using bash scripts on my Mac's terminal
  How should I fix this?
  
  user4980: It's not a curl problem.  (The 22 error is just passing along the server-side HTTP 400 error, which is because it dumped an error message into a URL.)  I think terdon is right and there's something wrong with your edirect installation.  You have esearch and efetch on your PATH but apparently not xtract and/or xtract.Darwin.
  
  More detail:
  Look toward the end of the error message, at the text being passed to curl's -d argument:
  db=pubmed&id=Unable%2Cto%2Clocate%2Cxtract%2Cexecutable.%2CPlease%2Cexecute%2Cthe%2Cfollowing%2Cnquire%2Cdwn%2Cftp.ncbi.nlm.nih.gov%2Centrez%2Centrezdirect%2Cxtract.Darwin.gz%2Cgunzip%2Cf%2Cxtract.Darwin.gz%2Cchmod%2Cx%2Cxtract.Darwin&rettype=medline&retmode=text&tool=edirect&edirect=16.1&edirect_os=Darwin&email=mariocatalano%40MBP-di-Mario.lan"
  
  It's putting this in the id= part:
  Unable%2Cto%2Clocate%2Cxtract%2Cexecutable.%2CPlease%2Cexecute%2Cthe%2Cfollowing%2Cnquire%2Cdwn%2Cftp.ncbi.nlm.nih.gov%2Centrez%2Centrezdirect%2Cxtract.Darwin.gz%2Cgunzip%2Cf%2Cxtract.Darwin.gz%2Cchmod%2Cx%2Cxtract.Darwin
  
  which is maybe something like (trying to guess which characters got turned into %2C):
  
  Unable to locate xtract executable. Please execute the following: nquire -dwn ftp.ncbi.nlm.nih.gov entrez/entrezdirect xtract.Darwin.gz; gunzip -f xtract.Darwin.gz; chmod +x xtract.Darwin
  
  But you should already have xtract and xtract.Darwin from the same edirect install that gave you esearch and efetch.
  For what it's worth the official Entrez Direct install on Mac OS looks a little goofy.  When I try it myself it ends with:
  Entrez Direct has been successfully downloaded and installed.
  
  -e In order to complete the configuration process, please execute the following:
  
    echo "export PATH=\\\${PATH}:" >> $HOME/.bashrc
    echo "export PATH=\\\${PATH}:" >> $HOME/.zshrc
  
  or manually edit the PATH variable assignments in your .bashrc and .zshrc files.
  
  Would you like to do that automatically now? [y/N]
  
  Those commands don't look right (what's getting added to the path? an empty string?) and if I say y, I get this at the end of .bashrc and .zshrc which definitely isn't right:
  export PATH=${PATH}:
  
  It seems like an empty string at the end of PATH behaves like . (current directory), so I can go into ~/edirect and run your command and it does actually work.  So this isn't exactly your problem... but still, that seems wrong.
  
original_text: 14388: <p>I've just dowloaded entrez direct on my Mac and I was trying to perform some simple queries like:</p>
  <pre><code>esearch -db pubmed -query &quot;tn3 transposition immunity&quot; | efetch -format medline
  </code></pre>
  <p>but I keep getting this error</p>
  <pre><code>curl: (22) The requested URL returned error: 400 Bad Request
   ERROR:  curl command failed ( Mar 19 Ott 2021 13:02:26 CEST ) with: 22 
  https://eutils.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi -d db=pubmed&amp;id=Unable%2Cto%2Clocate%2Cxtract%2Cexecutable.%2CPlease%2Cexecute%2Cthe%2Cfollowing%2Cnquire%2Cdwn%2Cftp.ncbi.nlm.nih.gov%2Centrez%2Centrezdirect%2Cxtract.Darwin.gz%2Cgunzip%2Cf%2Cxtract.Darwin.gz%2Cchmod%2Cx%2Cxtract.Darwin&amp;rettype=medline&amp;retmode=text&amp;tool=edirect&amp;edirect=16.1&amp;edirect_os=Darwin&amp;email=mariocatalano%40MBP-di-Mario.lan&quot;
  </code></pre>
  <p>I'm using bash scripts on my Mac's terminal</p>
  <p>How should I fix this?</p>
   4980: <p>It's not a curl problem.  (The <a href="https://curl.se/libcurl/c/libcurl-errors.html#CURLEHTTPRETURNEDERROR" rel="nofollow noreferrer">22 error</a> is just passing along the server-side HTTP 400 error, which is because it dumped an error message into a URL.)  I think terdon is right and there's something wrong with your edirect installation.  You have esearch and efetch on your PATH but apparently not xtract and/or xtract.Darwin.</p>
  <hr />
  <p>More detail:</p>
  <p>Look toward the end of the error message, at the text being passed to curl's <code>-d</code> argument:</p>
  <pre><code>db=pubmed&amp;id=Unable%2Cto%2Clocate%2Cxtract%2Cexecutable.%2CPlease%2Cexecute%2Cthe%2Cfollowing%2Cnquire%2Cdwn%2Cftp.ncbi.nlm.nih.gov%2Centrez%2Centrezdirect%2Cxtract.Darwin.gz%2Cgunzip%2Cf%2Cxtract.Darwin.gz%2Cchmod%2Cx%2Cxtract.Darwin&amp;rettype=medline&amp;retmode=text&amp;tool=edirect&amp;edirect=16.1&amp;edirect_os=Darwin&amp;email=mariocatalano%40MBP-di-Mario.lan&quot;
  </code></pre>
  <p>It's putting this in the <code>id=</code> part:</p>
  <pre><code>Unable%2Cto%2Clocate%2Cxtract%2Cexecutable.%2CPlease%2Cexecute%2Cthe%2Cfollowing%2Cnquire%2Cdwn%2Cftp.ncbi.nlm.nih.gov%2Centrez%2Centrezdirect%2Cxtract.Darwin.gz%2Cgunzip%2Cf%2Cxtract.Darwin.gz%2Cchmod%2Cx%2Cxtract.Darwin
  </code></pre>
  <p>which is maybe something like (trying to guess which characters got turned into <code>%2C</code>):</p>
  <blockquote>
  <p>Unable to locate xtract executable. Please execute the following: nquire -dwn ftp.ncbi.nlm.nih.gov entrez/entrezdirect xtract.Darwin.gz; gunzip -f xtract.Darwin.gz; chmod +x xtract.Darwin</p>
  </blockquote>
  <p>But you should already have xtract and xtract.Darwin from the same edirect install that gave you esearch and efetch.</p>
  <p>For what it's worth the official Entrez Direct install on Mac OS looks a little goofy.  When I try it myself it ends with:</p>
  <pre><code>Entrez Direct has been successfully downloaded and installed.
  
  -e In order to complete the configuration process, please execute the following:
  
    echo &quot;export PATH=\\\${PATH}:&quot; &gt;&gt; <span class="math-container">$HOME/.bashrc
    echo "export PATH=\\\${PATH}:" &gt;&gt; $</span>HOME/.zshrc
  
  or manually edit the PATH variable assignments in your .bashrc and .zshrc files.
  
  Would you like to do that automatically now? [y/N]
  </code></pre>
  <p>Those commands don't look right (what's getting added to the path? an empty string?) and if I say y, I get this at the end of .bashrc and .zshrc which definitely isn't right:</p>
  <pre><code>export PATH=${PATH}:
  </code></pre>
  <p>It seems like an empty string at the end of PATH behaves like <code>.</code> (current directory), so I can go into ~/edirect and run your command and it <em>does</em> actually work.  So this isn't exactly your problem... but still, that seems wrong.</p>
  