⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 unit-conversion.sh

📁 Shall高级编程
💻 SH
字号:
#!/bin/bash# unit-conversion.shconvert_units ()  # Takes as arguments the units to convert.{  cf=$(units "$1" "$2" | sed --silent -e '1p' | awk '{print $2}')  # Strip off everything except the actual conversion factor.  echo "$cf"}  Unit1=milesUnit2=meterscfactor=`convert_units $Unit1 $Unit2`quantity=3.73result=$(echo $quantity*$cfactor | bc)echo "There are $result $Unit2 in $quantity $Unit1."#  What happens if you pass incompatible units,#+ such as "acres" and "miles" to the function?exit 0

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -