#!/bin/bash
# Program:
# Let user keyin their first and last name, and show their full name.
# History:
# 2007/03/19 zhang First release
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
read -p "Please input your first name: " firstname
read -p "Please input your last name: " lastname
echo -e "\nYour full name is: $firstname $lastname"
这是网上的范例脚本,我绝对是照着做的,可是执行sh z1.sh
结果就是不去用参数。
Please input your first name:firstname111
Please input your last name: " lastname222
nYour full name is:
nYour full name is:这里不取用参数firstname lastname
我还有个就是path 那段是起什么作用,export 是什么意思!!
unix 于 2007-10-25 14:52:32发表:
建议在论坛里搜索SHELL方面的基础文章
葬桦 于 2007-03-20 09:25:58发表:
哦.好滴.
chameleon 于 2007-03-19 11:43:57发表:
建议在论坛里搜索SHELL方面的基础文章