title: "brew: Command not found" after fresh install with csh, PATH is correct
body: <p>I was simply trying to update <code>bash</code> on my macOS Mojave system by following <a href="https://itnext.io/upgrading-bash-on-macos-7138bd1066ba" rel="nofollow noreferrer">this article</a>, and stupidly deleted the old <code>bash</code> binary and tried to replace it with <code>sudo mv /usr/local/bin/bash /bin/bash</code>. This created a myriad of other problems, most of which I have fixed with <code>cp /bin/csh /bin/bash</code> and <code>chsh -s /bin/csh</code>, then <code>rm -f /bin/bash</code>.</p>
  
  <p>I have since tried <strong>three times</strong> to uninstall and reinstall homebrew (albeit without the use of Ruby and with a file redirect being necessary).</p>
  
  <h3>TL;DR:</h3>
  
  <p>I'm guessing this has something to do with the line shown below: <code>find: /bin/bash: No such file or directory</code>. The install also fails with <code>Failed during: /usr/local/bin/brew update --force</code> and trying to run an update manually gives the <code>brew: Command not found</code> error. <code>echo $PATH</code> returns <code>/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin</code> and I'm running all of these commands directly from <code>/usr/local/bin</code> anyway. So what gives?! MTIA :-)</p>
  
  <h3>Full Terminal output:</h3>
  
  <pre><code>[Kents-MacBook-Pro:/usr/local/bin] Kenny% ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
  Illegal variable name.
  [Kents-MacBook-Pro:/usr/local/bin] Kenny% curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall &gt; uninstall.sh
  [Kents-MacBook-Pro:/usr/local/bin] Kenny% chmod +x uninstall.sh 
  [Kents-MacBook-Pro:/usr/local/bin] Kenny% ./uninstall.sh
  Warning: This script will remove:
  /Users/Kenny/Library/Caches/Homebrew/
  /usr/local/Caskroom/
  /usr/local/Cellar/
  /usr/local/Homebrew/
  /usr/local/Homebrew/.editorconfig
  /usr/local/Homebrew/.github/
  /usr/local/Homebrew/.gitignore
  /usr/local/Homebrew/.yardopts
  /usr/local/Homebrew/CHANGELOG.md
  /usr/local/Homebrew/CONTRIBUTING.md
  /usr/local/Homebrew/Dockerfile
  /usr/local/Homebrew/LICENSE.txt
  /usr/local/Homebrew/Library/
  /usr/local/Homebrew/README.md
  /usr/local/Homebrew/bin/brew
  /usr/local/Homebrew/completions/
  /usr/local/Homebrew/docs/
  /usr/local/Homebrew/manpages/
  /usr/local/bin/brew -&gt; /usr/local/Homebrew/bin/brew
  /usr/local/var/homebrew/
  Are you sure you want to uninstall Homebrew? This will remove your installed packages! [y/N] y
  ==&gt; Removing Homebrew installation...
  find: /bin/bash: No such file or directory
  ==&gt; Removing empty directories...
  ==&gt; /usr/bin/sudo /usr/bin/find /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/sbin /usr/local/share /usr/local/var /usr/local/Frameworks -name .DS_Store -delete
  ==&gt; /usr/bin/sudo /usr/bin/find /usr/local/bin /usr/local/etc /usr/local/include /usr/local/lib /usr/local/opt /usr/local/sbin /usr/local/share /usr/local/var /usr/local/Frameworks -depth -type d -empty -exec rmdir {} ;
  ==&gt; Homebrew uninstalled!
  The following possible Homebrew files were not deleted:
  /usr/local/bin/
  /usr/local/.com.apple.installer.keep
  /usr/local/libexec/
  /usr/local/microsoft/
  /usr/local/include/
  /usr/local/sbin/
  /usr/local/remotedesktop/
  /usr/local/etc/
  /usr/local/lib/
  /usr/local/opt/
  /usr/local/git/
  /usr/local/share/
  You may wish to remove them yourself.
  [Kents-MacBook-Pro:/usr/local/bin] Kenny% curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install &gt; install.sh
  [Kents-MacBook-Pro:/usr/local/bin] Kenny% chmod +x install.sh
  [Kents-MacBook-Pro:/usr/local/bin] Kenny% ./install.sh
  ==&gt; This script will install:
  /usr/local/bin/brew
  /usr/local/share/doc/homebrew
  /usr/local/share/man/man1/brew.1
  /usr/local/share/zsh/site-functions/_brew
  /usr/local/etc/bash_completion.d/brew
  /usr/local/Homebrew
  ==&gt; The following new directories will be created:
  /usr/local/var
  /usr/local/share/zsh
  /usr/local/share/zsh/site-functions
  /usr/local/var/homebrew
  /usr/local/var/homebrew/linked
  /usr/local/Cellar
  /usr/local/Caskroom
  /usr/local/Homebrew
  /usr/local/Frameworks
  
  Press RETURN to continue or any other key to abort
  ==&gt; /usr/bin/sudo /bin/mkdir -p /usr/local/var /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
  ==&gt; /usr/bin/sudo /bin/chmod g+rwx /usr/local/var /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
  ==&gt; /usr/bin/sudo /bin/chmod 755 /usr/local/share/zsh /usr/local/share/zsh/site-functions
  ==&gt; /usr/bin/sudo /usr/sbin/chown Kenny /usr/local/var /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
  ==&gt; /usr/bin/sudo /usr/bin/chgrp admin /usr/local/var /usr/local/share/zsh /usr/local/share/zsh/site-functions /usr/local/var/homebrew /usr/local/var/homebrew/linked /usr/local/Cellar /usr/local/Caskroom /usr/local/Homebrew /usr/local/Frameworks
  ==&gt; /usr/bin/sudo /bin/mkdir -p /Users/Kenny/Library/Caches/Homebrew
  ==&gt; /usr/bin/sudo /bin/chmod g+rwx /Users/Kenny/Library/Caches/Homebrew
  ==&gt; /usr/bin/sudo /usr/sbin/chown Kenny /Users/Kenny/Library/Caches/Homebrew
  ==&gt; Downloading and installing Homebrew...
  remote: Enumerating objects: 127973, done.
  remote: Total 127973 (delta 0), reused 0 (delta 0), pack-reused 127973
  Receiving objects: 100% (127973/127973), 30.42 MiB | 4.88 MiB/s, done.
  Resolving deltas: 100% (93909/93909), done.
  From https://github.com/Homebrew/brew
   * [new branch]      master     -&gt; origin/master
   * [new tag]         0.1        -&gt; 0.1
   * [new tag]         0.2        -&gt; 0.2
   * [new tag]         0.3        -&gt; 0.3
   * [new tag]         0.4        -&gt; 0.4
   * [new tag]         0.5        -&gt; 0.5
   * [new tag]         0.6        -&gt; 0.6
   * [new tag]         0.7        -&gt; 0.7
   * [new tag]         0.7.1      -&gt; 0.7.1
   * [new tag]         0.8        -&gt; 0.8
   * [new tag]         0.8.1      -&gt; 0.8.1
   * [new tag]         0.9        -&gt; 0.9
   * [new tag]         0.9.1      -&gt; 0.9.1
   * [new tag]         0.9.2      -&gt; 0.9.2
   * [new tag]         0.9.3      -&gt; 0.9.3
   * [new tag]         0.9.4      -&gt; 0.9.4
   * [new tag]         0.9.5      -&gt; 0.9.5
   * [new tag]         0.9.8      -&gt; 0.9.8
   * [new tag]         0.9.9      -&gt; 0.9.9
   * [new tag]         1.0.0      -&gt; 1.0.0
   * [new tag]         1.0.1      -&gt; 1.0.1
   * [new tag]         1.0.2      -&gt; 1.0.2
   * [new tag]         1.0.3      -&gt; 1.0.3
   * [new tag]         1.0.4      -&gt; 1.0.4
   * [new tag]         1.0.5      -&gt; 1.0.5
   * [new tag]         1.0.6      -&gt; 1.0.6
   * [new tag]         1.0.7      -&gt; 1.0.7
   * [new tag]         1.0.8      -&gt; 1.0.8
   * [new tag]         1.0.9      -&gt; 1.0.9
   * [new tag]         1.1.0      -&gt; 1.1.0
   * [new tag]         1.1.1      -&gt; 1.1.1
   * [new tag]         1.1.10     -&gt; 1.1.10
   * [new tag]         1.1.11     -&gt; 1.1.11
   * [new tag]         1.1.12     -&gt; 1.1.12
   * [new tag]         1.1.13     -&gt; 1.1.13
   * [new tag]         1.1.2      -&gt; 1.1.2
   * [new tag]         1.1.3      -&gt; 1.1.3
   * [new tag]         1.1.4      -&gt; 1.1.4
   * [new tag]         1.1.5      -&gt; 1.1.5
   * [new tag]         1.1.6      -&gt; 1.1.6
   * [new tag]         1.1.7      -&gt; 1.1.7
   * [new tag]         1.1.8      -&gt; 1.1.8
   * [new tag]         1.1.9      -&gt; 1.1.9
   * [new tag]         1.2.0      -&gt; 1.2.0
   * [new tag]         1.2.1      -&gt; 1.2.1
   * [new tag]         1.2.2      -&gt; 1.2.2
   * [new tag]         1.2.3      -&gt; 1.2.3
   * [new tag]         1.2.4      -&gt; 1.2.4
   * [new tag]         1.2.5      -&gt; 1.2.5
   * [new tag]         1.2.6      -&gt; 1.2.6
   * [new tag]         1.3.0      -&gt; 1.3.0
   * [new tag]         1.3.1      -&gt; 1.3.1
   * [new tag]         1.3.2      -&gt; 1.3.2
   * [new tag]         1.3.3      -&gt; 1.3.3
   * [new tag]         1.3.4      -&gt; 1.3.4
   * [new tag]         1.3.5      -&gt; 1.3.5
   * [new tag]         1.3.6      -&gt; 1.3.6
   * [new tag]         1.3.7      -&gt; 1.3.7
   * [new tag]         1.3.8      -&gt; 1.3.8
   * [new tag]         1.3.9      -&gt; 1.3.9
   * [new tag]         1.4.0      -&gt; 1.4.0
   * [new tag]         1.4.1      -&gt; 1.4.1
   * [new tag]         1.4.2      -&gt; 1.4.2
   * [new tag]         1.4.3      -&gt; 1.4.3
   * [new tag]         1.5.0      -&gt; 1.5.0
   * [new tag]         1.5.1      -&gt; 1.5.1
   * [new tag]         1.5.10     -&gt; 1.5.10
   * [new tag]         1.5.11     -&gt; 1.5.11
   * [new tag]         1.5.12     -&gt; 1.5.12
   * [new tag]         1.5.13     -&gt; 1.5.13
   * [new tag]         1.5.14     -&gt; 1.5.14
   * [new tag]         1.5.2      -&gt; 1.5.2
   * [new tag]         1.5.3      -&gt; 1.5.3
   * [new tag]         1.5.4      -&gt; 1.5.4
   * [new tag]         1.5.5      -&gt; 1.5.5
   * [new tag]         1.5.6      -&gt; 1.5.6
   * [new tag]         1.5.7      -&gt; 1.5.7
   * [new tag]         1.5.8      -&gt; 1.5.8
   * [new tag]         1.5.9      -&gt; 1.5.9
   * [new tag]         1.6.0      -&gt; 1.6.0
   * [new tag]         1.6.1      -&gt; 1.6.1
   * [new tag]         1.6.10     -&gt; 1.6.10
   * [new tag]         1.6.11     -&gt; 1.6.11
   * [new tag]         1.6.12     -&gt; 1.6.12
   * [new tag]         1.6.13     -&gt; 1.6.13
   * [new tag]         1.6.14     -&gt; 1.6.14
   * [new tag]         1.6.15     -&gt; 1.6.15
   * [new tag]         1.6.16     -&gt; 1.6.16
   * [new tag]         1.6.17     -&gt; 1.6.17
   * [new tag]         1.6.2      -&gt; 1.6.2
   * [new tag]         1.6.3      -&gt; 1.6.3
   * [new tag]         1.6.4      -&gt; 1.6.4
   * [new tag]         1.6.5      -&gt; 1.6.5
   * [new tag]         1.6.6      -&gt; 1.6.6
   * [new tag]         1.6.7      -&gt; 1.6.7
   * [new tag]         1.6.8      -&gt; 1.6.8
   * [new tag]         1.6.9      -&gt; 1.6.9
   * [new tag]         1.7.0      -&gt; 1.7.0
   * [new tag]         1.7.1      -&gt; 1.7.1
   * [new tag]         1.7.2      -&gt; 1.7.2
   * [new tag]         1.7.3      -&gt; 1.7.3
   * [new tag]         1.7.4      -&gt; 1.7.4
   * [new tag]         1.7.5      -&gt; 1.7.5
   * [new tag]         1.7.6      -&gt; 1.7.6
   * [new tag]         1.7.7      -&gt; 1.7.7
   * [new tag]         1.8.0      -&gt; 1.8.0
   * [new tag]         1.8.1      -&gt; 1.8.1
   * [new tag]         1.8.2      -&gt; 1.8.2
   * [new tag]         1.8.3      -&gt; 1.8.3
   * [new tag]         1.8.4      -&gt; 1.8.4
   * [new tag]         1.8.5      -&gt; 1.8.5
   * [new tag]         1.8.6      -&gt; 1.8.6
   * [new tag]         1.9.0      -&gt; 1.9.0
   * [new tag]         1.9.1      -&gt; 1.9.1
   * [new tag]         1.9.2      -&gt; 1.9.2
   * [new tag]         1.9.3      -&gt; 1.9.3
   * [new tag]         2.0.0      -&gt; 2.0.0
   * [new tag]         2.0.1      -&gt; 2.0.1
   * [new tag]         2.0.2      -&gt; 2.0.2
   * [new tag]         2.0.3      -&gt; 2.0.3
   * [new tag]         2.0.4      -&gt; 2.0.4
   * [new tag]         2.0.5      -&gt; 2.0.5
   * [new tag]         2.0.6      -&gt; 2.0.6
   * [new tag]         2.1.0      -&gt; 2.1.0
   * [new tag]         2.1.1      -&gt; 2.1.1
   * [new tag]         2.1.10     -&gt; 2.1.10
   * [new tag]         2.1.11     -&gt; 2.1.11
   * [new tag]         2.1.12     -&gt; 2.1.12
   * [new tag]         2.1.13     -&gt; 2.1.13
   * [new tag]         2.1.14     -&gt; 2.1.14
   * [new tag]         2.1.15     -&gt; 2.1.15
   * [new tag]         2.1.2      -&gt; 2.1.2
   * [new tag]         2.1.3      -&gt; 2.1.3
   * [new tag]         2.1.4      -&gt; 2.1.4
   * [new tag]         2.1.5      -&gt; 2.1.5
   * [new tag]         2.1.6      -&gt; 2.1.6
   * [new tag]         2.1.7      -&gt; 2.1.7
   * [new tag]         2.1.8      -&gt; 2.1.8
   * [new tag]         2.1.9      -&gt; 2.1.9
  HEAD is now at 2963bbec9 Merge pull request #6647 from tommyang/bump-revision-zsh-completion
  Failed during: /usr/local/bin/brew update --force
  [Kents-MacBook-Pro:/usr/local/bin] Kenny% brew update --force
  brew: Command not found.
  </code></pre>