Advertisement
Hiteshw11

Addition Using Function in Bash

Jul 13th, 2020
986
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.15 KB | None | 0 0
  1. #!/bin/bash
  2. echo "Enter first number"
  3. read a
  4. echo "Enter second number"
  5. read b
  6. function f1()
  7. {
  8. sum=$(($1+$2))
  9. echo The addition is $sum
  10. }
  11. f1 $a $b
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement