bhupixb

Add two numbers in bash

Jun 20th, 2019
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.15 KB | None | 0 0
  1. #!bin/sh
  2. read -p "Enter the first number " x
  3. read -p "Enter the second number " y
  4.  
  5. sum=$(($x+$y))
  6. sum2=`expr $(($x%$y))`
  7.  
  8. echo $sum
  9. echo $sum2
Add Comment
Please, Sign In to add comment