Shell 减法

1. 数字相减

  • subtraction.sh
#!/usr/bin/env bash
printf "Enter the First Number: "
read -r a
printf "Enter the Second Number: "
read -r b
echo "$a - $b = $((a - b))"

执行:

$ bash subtraction.sh
Enter the First Number: 3
Enter the Second Number: 4
3 - 4 = -1

$ bash subtraction.sh
Enter the First Number: 5
Enter the Second Number: 3
5 - 3 = 2

Copyright © ghostwritten 浙ICP备2020032454号 2022 all right reserved,powered by Gitbook该文件修订时间: 2022-06-22 15:35:32

results matching ""

    No results matching ""