You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description:
Sir we can use double bracket for arithmetic operation in bash is more flexible way because it doesn't matter if there is a bracket or not. So I'm kindly suggesting to replace / include this double bracket guide.
Suggested Labels:
Improvement
Suggested Assignees: Affected Product Version: OS, DB, other environment details and versions: Steps to reproduce: Related Issues:
Current Code:
#!/bin/sh
A=70
B=90
val=`expr $A + $B`#Be Mindful about the spaces in between the "expr" , $A , + , $B characters, # which is a must. Otherwise script will throw a syntax error echo"A + B : $val"
val=`expr $A - $B`echo"A - B : $val"
val=`expr $A\*$B`echo"a * b : $val"
val=`expr $B / $A`echo"B / A : $val"
val=`expr $B % $A`echo"B % A : $val”
Suggesting Code
#!/usr/bin/bash
A=70
B=90
((val =$A+$B))echo"A + B : $val"((val=$A-$B))echo"A - B : $val"((val=$A*$B))echo"a * b : $val"((val =$B/$A))echo"B / A : $val"((val=$B%$A))echo"B % A : $val"
The text was updated successfully, but these errors were encountered:
Description:
Sir we can use double bracket for arithmetic operation in bash is more flexible way because it doesn't matter if there is a bracket or not. So I'm kindly suggesting to replace / include this double bracket guide.
Suggested Labels:
Improvement
Suggested Assignees:
Affected Product Version:
OS, DB, other environment details and versions:
Steps to reproduce:
Related Issues:
Current Code:
Suggesting Code
The text was updated successfully, but these errors were encountered: