shell 简单交互

interactive.sh

#! /bin/bash
echo "Hey what's Your First Name?"
read a
echo "welcome Mr./Mrs. $a, would you like to tell us, Your Last Name"
read b
echo "Thanks Mr./Mrs. $a $b for telling us your name"
echo "*******************"
echo "Mr./Mrs. $b, it's time to say you good bye"

执行:

$ bash interactive.sh
Hey what's Your First Name?
jack     
welcome Mr./Mrs. jack, would you like to tell us, Your Last Name
zong
Thanks Mr./Mrs. jack zong for telling us your name
*******************
Mr./Mrs. zong, it's time to say you good bye
Copyright © ghostwritten 浙ICP备2020032454号 2022 all right reserved,powered by Gitbook该文件修订时间: 2022-06-22 08:18:43

results matching ""

    No results matching ""