linux shell 脚本 2,理解Linux Shell和基本的Shell脚本(2)
編寫第三個腳本
這個腳本演示如何與shell腳本進行交互。
#! /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"
腳本運行的結果:
Hey what's Your First Name?
Avishek
welcome Mr./Mrs. Avishek, would you like to tell us, Your Last Name
Kumar
Thanks Mr./Mrs. Avishek Kumar for telling us your name
******************************************************
Mr./Mrs. Kumar, it's time to say you good bye
第一部分到此結束,請繼續關注我們后續的四個部分。
總結
以上是生活随笔為你收集整理的linux shell 脚本 2,理解Linux Shell和基本的Shell脚本(2)的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mac linux工具下载,xshell
- 下一篇: linux java平台,如何下载和安装