Changes

Jump to: navigation, search

Tutorial10: Shell Scripting - Part 1

382 bytes removed, 09:37, 5 March 2021
Math Operations
Refer to the diagram above and to the extreme right side for an example using the '''for loop''' with a '''list'''.
 
===Math Operations===
 
In order to make math operations work, we need to convert numbers stored as text�into binary numbers. We can do this by using the expr command or simply by using�2 pairs of round brackets (( )).�
Examples:
 
num1=5;num2=10�echo “$(expr $num1 + $num2)”�15��echo “$((num1-num2))”�-5��((product=num1*num2))�echo “$product”�50
=INVESTIGATION 1: CREATING A SHELL SCRIPT=
13,420
edits

Navigation menu