fork download
  1. #!/bin/bash
  2.  
  3. add() {
  4. local num1=$1
  5. local num2=$2
  6. local sum=$((num1 + num2))
  7. echo "The sum of $num1 and $num2 is: $sum"
  8. }
  9.  
  10. add 10 20
  11. add 100 200
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
The sum of 10 and 20 is: 30
The sum of 100 and 200 is: 300