fork download
  1. If basic salary is < 15000 then HRA=10% of basic 7 DA=90% of basic.
  2. If basic salary is >=15000 then HRA=500 of basic & DA=98% of basic.
  3. Echo ―enter Basic salary‖
  4. read basic
  5. if [ $basic -lt 15000 ]
  6. then
  7. hra=`expr 10 \* $basic / 100`
  8. da=`expr 90 \* $basic / 100`
  9. else
  10. hra=`expr 50 \* $basic / 100`
  11. da=`expr 98 \* $basic / 100`
  12. fi
  13. gs=`expr $basic + $hra + $da`
  14. echo "Gross salary : Rs. $gs"
  15.  
Success #stdin #stdout #stderr 0.01s 5300KB
stdin
Standard input is empty
stdout
Gross salary : Rs. +
stderr
./prog.sh: line 1: 15000: No such file or directory
./prog.sh: line 2: of: command not found
./prog.sh: line 2: =15000: Permission denied
./prog.sh: line 3: Echo: command not found
./prog.sh: line 5: [: -lt: unary operator expected
expr: non-integer argument
expr: non-integer argument