This leverages the arbitrary-precision command line calculator bc
Just add the function c (or similarly short) to your .bashrc:
c() { echo "$@" | bc -l; }| r1 = 100; | |
| r2 = 76; | |
| r3 = 42; | |
| overlap12 = 33; | |
| overlap13 = 21; | |
| overlap23 = 21; | |
| distance12 = r1+r2-overlap12; | |
| distance13 = r1+r3-overlap13; |
| #!/bin/sh | |
| # Copying dangerous commands from the internet and forgetting to trim the `$` off the start? | |
| # Getting all sorts of `# -bash: $: command not found` errors? | |
| # This script is for you! | |
| # `$ command` will now ask for confirmation before executing the gum you scraped off of stackoverflow! | |
| echo "You are about to run the command:" | |
| echo "$@" | |
| read -n 1 -p "Do you want to continue? [yN]: " answer |
This leverages the arbitrary-precision command line calculator bc
Just add the function c (or similarly short) to your .bashrc:
c() { echo "$@" | bc -l; }| #!/bin/bash | |
| catdeck() { | |
| if [[ "$#" -eq 0 ]]; then | |
| (>&2 echo "usage: $0 final_file_name.catdeck") | |
| exit 1 | |
| fi | |
| OUTPUTFILE=$(echo "$1" | sed 's/\.catdeck//') | |
| echo -n "" > "$OUTPUTFILE" |