#!/bin/sh
echo "welcome to salary calculator"
echo "Enter basic salary"
read basic
dp=$(( basic / 2 ))
da=$((( basic + dp ) * 35) / 100)
hra=$((( basic + dp ) * 8 )/ 100)
ma=$((( basic + dp ) * 8 ) / 100)
pf=$((( basic + dp ) * 10 ) / 100)
salary=$((((( basic + dp) + da ) + hra ) + ma - pf ))
echo "salary is=$salary"
Take the 2-minute tour
×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It's 100% free, no registration required.
|
||||
closed as off-topic by Costas, G-Man, Anthon, Ramesh, cuonglm Aug 18 at 16:57This question appears to be off-topic. The users who voted to close gave this specific reason:
|
||||
You will need to enclose the shell math with So the math will need to be:
You may place additional spaces within |
|||||
|
da=$((( basic + dp ) * 35 / 100))
and so on – Costas Aug 18 at 12:43