<blockquote>
  <p>-bash: =: command not found</p>
</blockquote>

<p>Leave out the initial dollar symbol when you assign the variable:</p>

<p><code>NEW_ADDRESS=$(./bitcoin-cli getnewaddress)</code></p>

<p>Use the dollar symbol when you use the variable:</p>

<p><code>echo $NEW_ADDRESS</code></p>

CC BY-SA 4.0
2019-02-26T20:00:20.767Z
2019-02-26T20:00:20.767Z
Alistair Mann
<p>I am trying to create a new bitcoin address and store it in a shell variable $NEW_ADDRESS.</p>

<p>When I run this command:</p>

<pre><code>$NEW_ADDRESS=$(./bitcoin-cli getnewaddress)
</code></pre>

<p>I get the following errors:</p>

<pre><code>error: Could not connect to the server 127.0.0.1:8332
Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
-bash: =: command not found
</code></pre>

<p>I have tried everything to fix the connection error, including typing the command:</p>

<pre><code>./bitcoind -rpcport=8332
</code></pre>

<p>Or even, changing the bitcoin config:</p>

<pre><code>nano ~/.bitcoin/bitcoin.conf
</code></pre>

<p>And typing these lines on the configuration:</p>

<pre><code>rpcconnect=127.0.0.1
rpcport=8332;
</code></pre>

<p>But nothing works. Does anyone have an idea on how to troubleshoot and fix this?</p>

<p>Thanks in advance.</p>

CC BY-SA 4.0
2019-02-26T17:43:26.163Z
try `ps aux | grep bitcoind` is the process running?
JBaczuk
<bitcoin-core><bitcoind><client><daemon>
Bitcoind daemon: error connecting to the server?
Komputer
# Bitcoind daemon: error connecting to the server?

(Asked by: username_0 on 2019-02-26)

I am trying to create a new bitcoin address and store it in a shell variable $NEW\_ADDRESS.

When I run this command:

```
$NEW_ADDRESS=$(./bitcoin-cli getnewaddress)

```

I get the following errors:

```
error: Could not connect to the server 127.0.0.1:8332
Make sure the bitcoind server is running and that you are connecting to the correct RPC port.
-bash: =: command not found

```

I have tried everything to fix the connection error, including typing the command:

```
./bitcoind -rpcport=8332

```

Or even, changing the bitcoin config:

```
nano ~/.bitcoin/bitcoin.conf

```

And typing these lines on the configuration:

```
rpcconnect=127.0.0.1
rpcport=8332;

```

But nothing works. Does anyone have an idea on how to troubleshoot and fix this?

Thanks in advance.

**Tags:** bitcoin-core, bitcoind, client, daemon

> **Comments:**
> **username_1**: try `ps aux | grep bitcoind` is the process running?  

---

## 1 answers

### Answer by username_2 on 2019-02-26. Score: 1

> -bash: =: command not found

Leave out the initial dollar symbol when you assign the variable:

`NEW_ADDRESS=$(./bitcoin-cli getnewaddress)`

Use the dollar symbol when you use the variable:

`echo $NEW_ADDRESS`


---

