Shell script to compute the Itaú & BROU mean USD/UYU exchange rate.
# Get exchange rates only
sh transa.sh
sh transa.sh itau
sh transa.sh brou
# Exchange rates + calculation for a certain amount
sh transa.sh <amount>
sh transa.sh <amount> brou
sh transa.sh <amount> itau
➜ sh transa.sh
Itaú compra y venta: 37.90, 40.30
(37.90 + 40.30) / 2 = 39.10
➜ sh transa.sh brou
eBROU compra y venta: 38.40000, 39.80000
(38.40000 + 39.80000) / 2 = 39.10
➜ sh transa.sh 850
Itaú compra y venta: 37.90, 40.30
(37.90 + 40.30) / 2 = 39.10
TRANSA: U$S 850.00 = $ 33235.00
➜ sh transa.sh 850 brou
eBROU compra y venta: 38.40000, 39.80000
(38.40000 + 39.80000) / 2 = 39.10
TRANSA: U$S 850.00 = $ 33235.00
➜ sh transa.sh \$50000
Itaú compra y venta: 37.90, 40.30
(37.90 + 40.30) / 2 = 39.10
TRANSA: U$S 1278.77 = $ 50000.00
➜ sh transa.sh \$50000 brou
eBROU compra y venta: 38.40000, 39.80000
(38.40000 + 39.80000) / 2 = 39.10
TRANSA: U$S 1278.77 = $ 50000.00
$
character with a \
If you'd like to type transa
instead of sh transa.sh
do the following:
chmod +x transa.sh # Make it executable
cp transa.sh /usr/local/bin/transa # Make it detectable by your shell