15 lines
514 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
#Program:
# 1. 判断 $1 是否为 hello如果是的话就显示 "Hello, how are you ?"
# 2. 如果没有加任何参数,就提示使用者必须要使用的参数下达法;
# 3. 而如果加入的参数不是 hello ,就提醒使用者仅能使用 hello 为参数。
#History:
# 2024/07/14 LouisFonda<yigencong@yahoo.com>
if [ ${1} == "hello" ]; then
echo "hello, how are you?"
elif [ "${1}" == "" ]; then
echo "你必须输入参数!"
else
echo "这个参数必须是 'hello'"
fi