fork download
  1. #!/bin/bash
  2. # your code goes here
  3. #!/bin/bash
  4.  
  5. echo "enter the first number"
  6. read a
  7. echo "enter the second number"
  8. read b
  9.  
  10. temp="$a"
  11. a="$b"
  12. b="$temp"
  13.  
  14. echo "after swapping:"
  15. echo "a=$a, b=$b"
Success #stdin #stdout 0.01s 5320KB
stdin
Standard input is empty
stdout
enter the first number
enter the second number
after swapping:
a=, b=