目录标题 1. if语句 2. if-else语句 3. if-elif-else语句 1. if语句 if语句形式: If condition then statement(s) fi If condition;then statement(s) fi 请注意condition后面的分号;,当if和then位于同一行时候,这个分号是必须的,否则会有语法错误。 #!/bin/bash username=student if grep $username /etc/passwd then echo The bash files for user $username are: ls