Linux Bash Maths Raise To The Power Example

Go down

Linux Bash Maths Raise To The Power Example Empty Linux Bash Maths Raise To The Power Example

Post by jamied_uk on 20th July 2016, 12:04





Code:
#!/bin/bash
# Usage: ./Power.sh 19
#
var=("$@") # User Input
echo "$var"^6 | bc # Customize to whatever Power you want, default here is 6
jamied_uk
jamied_uk
Admin

Posts : 2471
Join date : 2010-05-09
Age : 36
Location : UK

http://address-shortner.co.uk

Back to top Go down

Linux Bash Maths Raise To The Power Example Empty Re: Linux Bash Maths Raise To The Power Example

Post by jamied_uk on 20th July 2016, 12:15

To use a range without the need for loops



Code:
#!/bin/bash
# Usage: ./range.sh
#
echo {1..99}
jamied_uk
jamied_uk
Admin

Posts : 2471
Join date : 2010-05-09
Age : 36
Location : UK

http://address-shortner.co.uk

Back to top Go down

Back to top


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