文件名称:Linux if语句详解
文件大小:33KB
文件格式:DOC
更新时间:2014-01-18 05:52:32
Linux if
详细讲解了Linux中if语句的使用 脚本示例: #!/bin/bash # This script prints a message about your weight if you give it your # weight in kilos and hight in centimeters. if [ ! $# == 2 ]; then echo "Usage: $0 weight_in_kilos length_in_centimeters" exit fi weight="$1" height="$2" idealweight=$[$height - 110] if [ $weight -le $idealweight ] ; then echo "You should eat a bit more fat." else