1、
#!/bin/bash
user=`whoami`
echo hello $user
host=`hostname`
echo 机器名:$host
ls ..
echo $PATH
echo $HOME
df -h
id -g
echo Good bye $user
2、
#!/bin/bash
whoami
id -u
pwd
3、
#!/bin/bash
ID1=`head -10 /etc/passwd | tail -1 | cut -d ":" -f "3"`
ID2=`head -20 /etc/passwd | tail -1 | cut -d ":" -f "3"`
echo $(($ID1+$ID2))
4、
#!/bin/bash
read -p "请输入学生成绩" score
if test $score -gt 100
then
echo 请重新输入
elif test $score -ge 90
then
echo A
elif test $score -ge 80
then
echo B
elif test $score -ge 70
then
echo C
elif test $score -ge 60
then
echo D
else
echo E
fi