# 在 Mac 终端中执行 source ~/.bashrc 后陷入无限循环

**URL:** https://meta.discourse.org/t/stuck-in-infinite-loop-in-mac-terminal-after-source-bashrc/118505
**Category:** Support
**Created:** [2019年五月23日 12:42 UTC](https://meta.discourse.org/t/stuck-in-infinite-loop-in-mac-terminal-after-source-bashrc/118505 "2019-05-23T12:42:41Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![jameshahnii](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jameshahnii/32/108982_2.png) [@jameshahnii](https://meta.discourse.org/u/jameshahnii)
#### Post date: [2019年五月23日 12:42 UTC](https://meta.discourse.org/t/stuck-in-infinite-loop-in-mac-terminal-after-source-bashrc/118505/1 "2019-05-23T12:42:41Z")

</div>

Howdy, dipping back into Discourse development after a long divergence into learning Ember.js. As I’ve hacked away over the past few days trying to remember how I did all this back in August/September I’ve opened terminal to find a script running on what looked like an infinite loop.

Finally decided to go back to the [Beginners Guide to Install Discourse on macOS for Development](https://meta.discourse.org/t/beginners-guide-to-install-discourse-on-macos-for-development/15772) yesterday. Kept running into a brick wall so restored a back-up of my droplet and decided to start again in the morning.

Just opened terminal and had to `ctrl+c` again to stop the loop. Tried to ssh root and it threw another `Permission denied` so I decided to get Discourse going local again. I proceeded with…

1. `git clone https://github.com/discourse/discourse.git ~/discourse`
2. `cd ~/discourse`
3. `source ~/.bashrc`

Step 3 kicked off the infinite loop I’ve seen the past few days. This is what it looks like.

 ![bashrc](https://global.discourse-cdn.com/meta/original/3X/5/4/54802b627661fab12711d65e0370e27d64a3444c.gif)

Does anyone have a solution? I’d love to avoid deleting everything and starting over.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2019年五月23日 12:54 UTC](https://meta.discourse.org/t/stuck-in-infinite-loop-in-mac-terminal-after-source-bashrc/118505/2 "2019-05-23T12:54:58Z")

</div>

You’ll need to look in `.bashrc` and see what it’s doing.

---

<div class="post-metadata">

### Author: ![jameshahnii](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jameshahnii/32/108982_2.png) [@jameshahnii](https://meta.discourse.org/u/jameshahnii)
#### Post date: [2019年五月23日 13:03 UTC](https://meta.discourse.org/t/stuck-in-infinite-loop-in-mac-terminal-after-source-bashrc/118505/3 "2019-05-23T13:03:55Z")

</div>

Have all hidden files visible and it doesn’t seem to exist… which is puzzling.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [2019年五月23日 13:07 UTC](https://meta.discourse.org/t/stuck-in-infinite-loop-in-mac-terminal-after-source-bashrc/118505/4 "2019-05-23T13:07:36Z")

</div>

If you can’t find `.bashrc` . . . wait. You don’t need to source `.bashrc` since it gets run when you log in.

I recommend that you punt on that and use [Install Discourse for development using Docker](https://meta.discourse.org/t/beginners-guide-to-install-discourse-for-development-using-docker/102009).

---

<div class="post-metadata">

### Author: ![jameshahnii](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jameshahnii/32/108982_2.png) [@jameshahnii](https://meta.discourse.org/u/jameshahnii)
#### Post date: [2019年五月23日 13:08 UTC](https://meta.discourse.org/t/stuck-in-infinite-loop-in-mac-terminal-after-source-bashrc/118505/5 "2019-05-23T13:08:09Z")

</div>

Perfect. Thank you, sir!

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [2022年十月10日 18:47 UTC](https://meta.discourse.org/t/stuck-in-infinite-loop-in-mac-terminal-after-source-bashrc/118505/6 "2022-10-10T18:47:11Z")

</div>



---

<div class="post-metadata">

### Author: ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)
#### Post date: [2022年十月10日 19:07 UTC](https://meta.discourse.org/t/stuck-in-infinite-loop-in-mac-terminal-after-source-bashrc/118505/7 "2022-10-10T19:07:55Z")

</div>


