user125: With bitcoin 0.4.0 I have encrypted my wallet. Now when I would want to use bitcoind, the only way to send money is to provide my wallet decryption key on the cmd line first. I do not want to do that as my password will show up in the shell history. 
Is there a way to let bitcoind ask for the wallet passphrase?

user6441: The official developer answer is to use the provided python wrapper in contrib/bitrpc/bitrpc.py (github):

It asks for a password in a secure way if you use the command walletpassphrase, for example. There are no plans to add interactive functionality to bitcoin-cli. 

and:

bitcoin-cli will remain as-is and not gain interactive functionality.

Source: #2318
Unlock wallet: 
$ python bitrpc.py walletpassphrase

Change passphrase:
$ python bitrpc.py walletpassphrasechange

https://github.com/bitcoin/bitcoin/tree/master/contrib/bitrpc

user659: You can avoid having the password show up in the shell history like this:
$ read x
password goes here
$ bitcoind walletpassphrase "$x" 60
$ x=
$ 

The read x command reads the next line of text you type and puts it into a shell variable x.
The x= command overwrites the shell variable; otherwise $x will hold your password until you exit the current shell.
It shows up in the history like this:
2032  read x
2033  bitcoind walletpassphrase "$x" 60
2034  x=
2035  history

I expect the password will show up in /proc/ while the bitcoind command is running, but that should be only for a fraction of a second.

user22: Anything you can do from the command line you can also do from the JSON API which means that the same unlock command could be sent from within code just as easily. To my knowledge there is no pre-built utility capable of this, but the API is simple enough that I can't imagine it being terribly difficult to actually build such a tool.

Edit: It was much easier than expected to do this in Python. Assuming you have Python's JSON-RPC module installed just use this code:
from jsonrpc import ServiceProxy
from getpass import getpass
access = ServiceProxy("http://127.0.0.1:8332")
pwd = getpass("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)

Similarly you could call access.walletlock() to lock the wallet on demand and walletpassphrasechange(old, new) to change the passphrase without ever having it see the command line.

Edit 2: I also submitted an issue to the devs on github on your behalf.
Edit 3: A pull request containing my python scripts has been accepted. Downloading the bitcoin source from github now includes scripts for this purpose in contrib/wallettools
Edit 4: A new bug report was filed to request that the builtin command behaves properly.

125: <p>With bitcoin 0.4.0 I have encrypted my wallet. Now when I would want to use bitcoind, the only way to send money is to provide my wallet decryption key on the cmd line first. I do not want to do that as my password will show up in the shell history. </p>

<p>Is there a way to let bitcoind ask for the wallet passphrase?</p>
 6441: <p>The official developer answer is to use the provided python wrapper in <code>contrib/bitrpc/bitrpc.py</code> (<a href="https://github.com/bitcoin/bitcoin/blob/master/contrib/bitrpc/bitrpc.py" rel="nofollow">github</a>):</p>

<blockquote>
  <p>It asks for a password in a secure way if you use the command <code>walletpassphrase</code>, for example. There are no plans to add interactive functionality to <code>bitcoin-cli</code>. </p>
</blockquote>

<p>and:</p>

<blockquote>
  <p><code>bitcoin-cli</code> will remain as-is and not gain interactive functionality.</p>
</blockquote>

<p>Source: <a href="https://github.com/bitcoin/bitcoin/issues/2318" rel="nofollow">#2318</a></p>

<p>Unlock wallet: </p>

<pre><code>$ python bitrpc.py walletpassphrase
</code></pre>

<p>Change passphrase:</p>

<pre><code>$ python bitrpc.py walletpassphrasechange
</code></pre>

<p><a href="https://github.com/bitcoin/bitcoin/tree/master/contrib/bitrpc" rel="nofollow">https://github.com/bitcoin/bitcoin/tree/master/contrib/bitrpc</a></p>
 659: <p>You can avoid having the password show up in the shell history like this:</p>

<pre><code>$ read x
password goes here
$ bitcoind walletpassphrase "$x" 60
$ x=
$ 
</code></pre>

<p>The <code>read x</code> command reads the next line of text you type and puts it into a shell variable <code>x</code>.</p>

<p>The <code>x=</code> command overwrites the shell variable; otherwise $x will hold your password until you exit the current shell.</p>

<p>It shows up in the history like this:</p>

<pre><code>2032  read x
2033  bitcoind walletpassphrase "$x" 60
2034  x=
2035  history
</code></pre>

<p>I expect the password will show up in /proc/ while the <code>bitcoind</code> command is running, but that should be only for a fraction of a second.</p>
 22: <p>Anything you can do from the command line you can also do from the JSON API which means that the same unlock command could be sent from within code just as easily. To my knowledge there is no pre-built utility capable of this, but the API is simple enough that I can't imagine it being terribly difficult to actually build such a tool.</p>

<hr>

<p><strong>Edit:</strong> <em>It was much easier than expected to do this in Python. Assuming you have Python's <a href="http://json-rpc.org/wiki/python-json-rpc" rel="nofollow">JSON-RPC</a> module installed just use this code:</em></p>

<pre><code>from jsonrpc import ServiceProxy
from getpass import getpass
access = ServiceProxy("http://127.0.0.1:8332")
pwd = getpass("Enter wallet passphrase: ")
access.walletpassphrase(pwd, 60)
</code></pre>

<p>Similarly you could call <code>access.walletlock()</code> to lock the wallet on demand and <code>walletpassphrasechange(old, new)</code> to change the passphrase without ever having it see the command line.</p>

<hr>

<p><strong>Edit 2:</strong> <em>I also submitted an <a href="https://github.com/bitcoin/bitcoin/issues/548" rel="nofollow">issue</a> to the devs on github on your behalf.</em></p>

<p><strong>Edit 3:</strong> <em>A pull request containing my python scripts has been accepted. Downloading the bitcoin source <a href="https://github.com/bitcoin/bitcoin" rel="nofollow">from github</a> now includes scripts for this purpose in contrib/wallettools</em></p>

<p><strong>Edit 4:</strong> <em>A <a href="https://github.com/bitcoin/bitcoin/issues/2318" rel="nofollow">new bug report</a> was filed to request that the builtin command behaves properly.</em></p>
