#!/bin/sh salutation="Hello" echo $salutation set foo bar bam echo "The program $0 is now running" echo "The second parameter was $2" 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 complete" exit 0<span style="color:#cc0000;"> </span>
这个脚本程序创建变量并显示它的内容,然后显示各种参数变量以及环境变量$HOME都已经存在并有了适当的值。
shell脚本程序中的部分常用环境变量和参数变量的说明以及简单shell脚本示例
原文地址:http://blog.csdn.net/u014488381/article/details/41678743