1
0
mirror of https://github.com/bitcoinbook/bitcoinbook synced 2024-11-15 12:39:01 +00:00
bitcoinbook/tools/discouraged.sh
David A. Harding 0249c97460 CH01: edits for Mark (Xekyo) Erhardt feedback (thanks!)
- Provide rough block and year when 99% of all BTC will have been mined

- Remove user-stories section.  I think this section frontloaded too
  much irrelevant detail.  In new sections of this edition, I've
  exclusively used the convential Alice, Bob, Carol, etc.---without
  trying to maintain a consistent backstory.  This is simpler on the
  writer and, I think, simpler on the reader---if they jump into a
  section of the book, they don't need to worry that there's some
  important context in a previous section.

    - This also necessitated a few changes chapter 2.

- Mostly remove the phrase "custody".  Instead use the phares "control
  the key".  I think this is clearer to non-specialists and a quick grep
  shows that we don't use any version of the word "custody" elsewhere in
  the book.

- Drop localbitcoins.com.  This service was terminated after this
  chapter was updated.

- Add 'feerate' to the script for catching forbidden words.  :-( This
  required a change to a comment in an image source.

- Other minor changes and typo fixes
2023-08-01 07:11:27 -10:00

40 lines
825 B
Bash
Executable File

#!/bin/bash -u
## Main discouraged words
for f in $( git ls-files | grep -v "$0" ) ; do
# 1. Find discouraged words
# 2. Ignore things that look like json or code (Bitcoin Core RPCs use many discouraged words)
egrep -if <( sed "1,/[S]TART DISCOURAGED WORDS/d" "$0" ) "$f" \
| grep -v "[\"'][a-zA-Z]\+[\"']" \
| if grep . ; then
echo "DISCOURAGED WORDS FOUND IN $f"
fi
done
## Discouraged words that require special greps
for f in $( git ls-files | grep -v "$0" ) ; do
{
echo -n
} | if grep . ; then echo "DISCOURAGED WORDS FOUND IN $f" ; exit 1 ; fi
done
exit
## START DISCOURAGED WORDS
BIP-[1-9]
BIP0
BIP [0-9]
\<nversion\>
\<nsequence\>
\<nlocktime\>
\<locktime\>
\<vin\>
\<vout\>
\<scriptSig\>
\<scriptPubKey\>
\<redeemScript\>
\<nAmount\>
\<nValue\>
witness field
witness element
feerate