1,[root@linux ~] vi sh02.sh
#!/bin/bash
PATH = …………………………….
export PATH
read –p “please input your first name:” firstname
read –p “please input your last name :” lastname
echo –e “your full name is $firstname $lastname”
2,判断一个文件是否存在
[root@linux ~] test –e /dmtsai && echo “exist” || echo “not exist”
3,[root@linux ~] vi sh07.sh
#!/bin/bash
PATH = …………………………….
export PATH
echo THE script name is ==> $0“
[-n “$1”] && echoe “the 1st parameter is ==> $1” || exit 0
[-n “$2”] && echoe “the 2en parameter is ==> $2” || exit 0
[-n “$3”] && echoe “the 3rd parameter is ==> $3” || exit 0