mirror of
https://github.com/ChristopherA/Learning-Bitcoin-from-the-Command-Line.git
synced 2025-06-06 23:46:22 +00:00
updated with new examples just in case
This commit is contained in:
parent
fc4f80f9b8
commit
07af202fa4
@ -20,15 +20,17 @@ These commands clear the NEW_ADDRESS_1 variable, just to be sure, then fill it w
|
||||
You can then use your shell's `echo` command to look at your (new) address:
|
||||
```
|
||||
$ echo $NEW_ADDRESS_1
|
||||
n4cqjJE6fqcmeWpftygwPoKMMDva6BpyHf
|
||||
mi25UrzHnvn3bpEfFCNqJhPWJn5b77a5NE
|
||||
```
|
||||
Because you have your address in a variable, you can now easily sign a message for that address, without worrying about mistyping the address. You'll of course save that signature into a variable too!
|
||||
```
|
||||
$ NEW_SIG_1=$(bitcoin-cli signmessage $NEW_ADDRESS_1 "Hello, World")
|
||||
$ echo $NEW_SIG_1
|
||||
IPYIzgj+Rg4bxDwCyoPiFiNNcxWHYxgVcklhmN8aB2XRRJqV731Xu9XkfZ6oxj+QGCRmTe80X81EpXtmGUpXOM4=
|
||||
```
|
||||
The rest of this tutorial will use this style of saving information to variables when it's practical.
|
||||
|
||||
_When is it not practical to use command-line variables?_ Command-line variables aren't practical if you need to use the information somewhere other than on the command line. For example, saving your signature may not actually be useful if you're just going to have to send it to someone else in an email. In addition, some future commands will output JSON objects instead of simple information, and variables can't be used to capture that information ... at least not without a _little_ more work.
|
||||
> :book: ***When is it not practical to use command-line variables?*** Command-line variables aren't practical if you need to use the information somewhere other than on the command line. For example, saving your signature may not actually be useful if you're just going to have to send it to someone else in an email. In addition, some future commands will output JSON objects instead of simple information, and variables can't be used to capture that information ... at least not without a _little_ more work.
|
||||
|
||||
## Summary: Using Command-Line Variables
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user