Hello Word!
#!/bin/bash #声明shell
#Program:
# This program shows "Hello Word!" in your scream.
#History:
#2016/04/08 17:53 k First release
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin #声明path
export PATH
echo -e 'Hello Word! \a \n'
exit 0
执行结果:
交互式 read and echo
#!/bin/bash
#Program:
# User inputs his first name and last name.Program shows his fullname.
#History:
#2016/04/08 18:23 k 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 "Your full name is: $firstname $lastname" #注意" "否则将输出Your full name is: $firstname $lastname