Bash Percentage Calculator For Linux

View previous topic View next topic Go down

Bash Percentage Calculator For Linux

Post by jamied_uk on 26th January 2016, 21:40

Code:
#!/bin/bash
# (c) J~Net 2016 Bash Percentage Calc
# this will calc percentage % Forum http://jnet.forumn.biz/t1034-bash-percentage-calculator-for-linux#1364
# Usage: bash perc.sh
echo -e "Enter A Number \c"      # get user input
read INPUT
num1=$INPUT
echo -e "Enter The Desired Percentage \c"      # get user input
read INPUT2
num2=$INPUT2
echo -e $((INPUT / 100 * INPUT2))


Version 2

Code:
#!/bin/bash
# (c) J~Net 2016 Bash Percentage Calc
# this will calc percentage %
# Usage: bash perc.sh
echo -e "Enter A Number \c"      # get user input
read INPUT
echo -e "Enter The Desired Percentage \c"      # get user input
read INPUT2
tot=$((INPUT / 100 * INPUT2))
echo -e "Your Number "$INPUT
echo -e "Percentage "$INPUT2
echo -e "Answer "$tot


Last edited by jamied_uk on 26th January 2016, 22:40; edited 3 times in total
avatar
jamied_uk
Admin

Posts : 2260
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

Re: Bash Percentage Calculator For Linux

Post by jamied_uk on 26th January 2016, 21:58

https://app.box.com/s/cx77cvrdk90ae5nzk8meq8yf9bkj9lku
avatar
jamied_uk
Admin

Posts : 2260
Join date : 2010-05-09
Age : 34
Location : UK

http://address-shortner.co.uk

Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum