习题的问题:
|
我的答案:
第一题:
backup database; restart web service; backup files; etc..
第二题:
#!/bin/bash
#exercise 2.2
#show date and time
echo "The date and time is: "
date
echo "lists all logged-in users: "
who
echo "the uptime is: "
uptime
echo "write the information above into file ./ex2.2.out"
#if the file ./ex2.2.out exists, delete it at first.
#to do.
echo "The date and time is: " >> ./ex2.2.out
date >> ./ex2.2.out
echo "lists all logged-in users: " >> ./ex2.2.out
who >> ./ex2.2.out
echo "the uptime is: " >> ./ex2.2.out
uptime >> ./ex2.2.out
echo "finished the work,exit."
exit 0