Linux程序设计

2.6 shell的语法

2.6.1  变量

参数变量

 

 

 

 

 

实验:使用参数和环境变量

#!/bin/sh

salutation="Hello"
echo $salutation
echo "The program $0 is now running"
echo "The first parameter was $1"
echo "The parameter list was $*"
echo "The user's home directory is $HOME"

echo "Please enter a new greeting"
read salutation

echo $salutation
echo "The script is now complete"
exit 0

 

 

2.6.2  条件

 

chmod   +x   try_var

 

2.6.3  控制结构

2.6.4  函数

17.有用的命令和正则表达式

 

 

posted on 2022-07-04 21:03  ccxwyyjy  阅读(38)  评论(0)    收藏  举报