Skip to content

Instantly share code, notes, and snippets.

@mulatinho
Created August 11, 2016 15:25
Show Gist options
  • Save mulatinho/a4c8ee4b5a0d6162e32834b371085394 to your computer and use it in GitHub Desktop.
Save mulatinho/a4c8ee4b5a0d6162e32834b371085394 to your computer and use it in GitHub Desktop.
tesourodireto.txt
initial - representa o valor inicial investido;
interest - a taxa de rendimento médio mensal;
months - o número de meses em que o investimento será realizado;
$ initial=50000; interest=1.00961; months=60; for i in `seq 1 $months`; do initial=`echo "scale=2; $initial * $interest"|bc`; printf "month %2d, r$ %12.2f\n" $i $initial; done
month 1, r$ 50480.50
month 2, r$ 50965.62
month 3, r$ 51455.40
month 4, r$ 51949.88
month 5, r$ 52449.12
month 6, r$ 52953.16
month 7, r$ 53462.04
month 8, r$ 53975.81
month 9, r$ 54494.52
month 10, r$ 55018.21
month 11, r$ 55546.93
month 12, r$ 56080.74
month 13, r$ 56619.67
month 14, r$ 57163.79
month 15, r$ 57713.13
month 16, r$ 58267.76
month 17, r$ 58827.71
month 18, r$ 59393.04
month 19, r$ 59963.81
month 20, r$ 60540.06
month 21, r$ 61121.85
month 22, r$ 61709.23
month 23, r$ 62302.26
month 24, r$ 62900.99
month 25, r$ 63505.46
month 26, r$ 64115.75
month 27, r$ 64731.90
month 28, r$ 65353.98
month 29, r$ 65982.03
month 30, r$ 66616.12
month 31, r$ 67256.30
month 32, r$ 67902.63
month 33, r$ 68555.17
month 34, r$ 69213.99
month 35, r$ 69879.14
month 36, r$ 70550.67
month 37, r$ 71228.67
month 38, r$ 71913.17
month 39, r$ 72604.26
month 40, r$ 73301.99
month 41, r$ 74006.42
month 42, r$ 74717.62
month 43, r$ 75435.66
month 44, r$ 76160.59
month 45, r$ 76892.50
month 46, r$ 77631.43
month 47, r$ 78377.47
month 48, r$ 79130.68
month 49, r$ 79891.12
month 50, r$ 80658.88
month 51, r$ 81434.01
month 52, r$ 82216.59
month 53, r$ 83006.69
month 54, r$ 83804.39
month 55, r$ 84609.75
month 56, r$ 85422.85
month 57, r$ 86243.76
month 58, r$ 87072.56
month 59, r$ 87909.33
month 60, r$ 88754.14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment