Closed tpruvot closed 8 years ago
Quoting or escaping the "all accounts" specifier as '*'
, "*"
, or \*
all work fine here. Tested using both OpenBSD's ksh and GNU bash.
hmm indeed with the full command line... i use a dcrw-cli bash script to prevent users and passwords in my bash history
#!/bin/bash
CLI=/work/bitcoin/decred/dcrctl
OPT="--rpcuser=.... --rpcserver=127.0.0.1:15741"
$CLI $OPT --wallet $*
The various escaping for * works for me in bash scripts as well just like for @jrick when on command lines. I've been doing it that way for a while since I tend to run dcrd (and btcd for that matter) in tmux sessions started by bash scripts so I like to pass commands to it from there.
with the above script...
bash --version GNU bash, version 4.3.11(1)-release (x86_64-pc-linux-gnu)
ubuntu 14.04.3 LTS
dcrw-cli listtransactions \ 50 listtransactions command: wrong number of params (expected between 0 and 4, received 11) (code: ErrNumParams) Usage: listtransactions ("account" count=10 from=0 includewatchonly=false) dcrw-cli listtransactions "*" 50 -4: Transactions are not yet grouped by account dcrw-cli listtransactions '' 50 listtransactions command: wrong number of params (expected between 0 and 4, received 11) (code: ErrNumParams) Usage: listtransactions ("account" count=10 from=0 includewatchonly=false)
Usually, the better way to keep passwords out of your bash history is to put them in the config file for dcrd, dcrwallet, and dcrctl.
While we can't really support the tools you write, in this case I've seen similar enough things to suggest something like: jcv@koopa ~ $ cat test.sh
CMD="dcrctl --wallet" exec $CMD "$@"
which works fine for me with: ./test.sh listtransactions "*" 5
thanks, will try "$@"
To show a custom number of entries i had to use the wallet --terminal to be able to use the "*"
on the linux command line * means all files, tried to quote and use backslashes without success
I suggest to allow the empty string "" as account to list all, like its explained in help (* or unset)