📌  相关文章
📜  在 shell 脚本中不使用第三个变量交换两个数字 - Shell-Bash 代码示例

📅  最后修改于: 2022-03-11 14:50:39.006000             🧑  作者: Mango

代码示例1
#!/bin/bash
echo "enter first number"
read a
echo "enter second number"
read b
echo "a before swapping is $a and b is $b"
#swapping
a=$((a+b))
b=$((a - b))
a=$((a-b))
echo "a after swapping is  $a and b is $b"