超简单的一段shell代码,查看电脑属性,删除无效安装包,查看天气。FYI 

#!/bin/bash
echo -e '\n'
echo "Hello,`whoami`"
echo "-----------------------------------------------------------------------"
echo "Now time is:`date`"
#wheather info
if [ -e "101020100.html" ];then
rm -f .html
wget http://www.weather.com.cn/data/cityinfo/101020100.html -q
else
wget http://www.weather.com.cn/data/cityinfo/101020100.html -q
fi
var=$(cat .html)
#echo "天气信息:" $var
echo $var | awk -F '"' '{print $6 " " $14 " ~ " $18 " " $22 " [ " $34 " ] "}'
echo "-----------------------------------------------------------------------"
echo -e '\n'
echo "-----------------------------------------------------------------------"
echo -e "The PC Info:"
uname -a
echo "-----------------------------------------------------------------------"
echo -e '\n'
echo "-----------------------------------------------------------------------"
echo 'Shall you clean trash?'
echo "Please input (y\n)"
read char
if [ $char == 'y' ];then
#delete useless install package
sudo apt-get autoclean
sudo apt-get clean
sudo apt-get autoremove
else
echo "You selected no"
fi
echo "-----------------------------------------------------------------------"
echo "Press anykey to exit..."

最新文章

  1. hibernate学习(7)——HQL查询
  2. s5pv210 cpu运行debian
  3. CentOS 7 安装 MySQL Database
  4. CNC Fanuc 设备数据采集
  5. (转)JS浮动窗口(随浏览器滚动而滚动)
  6. OpenJudge/Poj 1316 Self Numbers
  7. solrj6.2异常--Expected mime type application/octet-stream but got text/html.
  8. 五子棋Web版的开发(二)--整合Spring4.3+hibernate4+Struts2.3
  9. iOS Development: Proper Use of initWithNibName:bundle: Affects UITableViewController
  10. hdu 2838 Cow Sorting
  11. Good Time 冲刺 二
  12. 【JavaScript 6连载】一、关于对象(访问)
  13. MVC 控制器中传递dynamic(对象) 给视图
  14. google浏览器mac上跨域问题解决
  15. 贴心的vs 备注提醒功能
  16. Transformer-view java实体 转换视图 Lists.transform
  17. Redis hash数据结构
  18. numpy数组与python的list互转,然后用json写入文件与c交互
  19. AngularCSS 的引入: CSS On-Demand for AngularJS
  20. Null Coalescing Operator

热门文章

  1. MySQL对NULL值的处理
  2. 在Freeplane中显示与隐藏层级图标
  3. android studio依赖库工程Activity显示问题及库工程设置
  4. 最近一段时间get到的小知识(c++的)
  5. ios下点击穿透focus获取问题
  6. spring、struts整合
  7. CodeForces 710A King Moves
  8. 嵌入式系统基础知识(一): 系统结构和嵌入式Linux
  9. 【转】如何将ACCESS数据库后缀名accdb改为mdb
  10. 初学laravel框架,解决访问路由404的问题