一些环境变量获取。。。——脚本

一些环境变量获取。。。——脚本

编写一个名为ex1.sh的脚本,它包括一下内容:
(1)包含一段注释,列出你的名字、脚本的名称
(2)获取当前用户名,显示用户问候信息
(3)显示当前的日期和时间
(4)显示这个 月的日历
(5)显示你机器的主机名
(6)显示当前操作系统的名称和版本
(7)显示父目录中所有文件的列表
(8)显示变量TEAM、PATH和HOME的值

  1 #! /bin/bash
  2 #ex1.sh
  3 echo "the user is `whoami`,hello `whoami`"
  4 echo "the date is `date`"
  5 echo "the calendar is `cal`"
  6 echo "the hostname is `hostname`"
  7 echo "the version is `uname -a`"
  8 echo "the list is `ls`"
  9 echo "the them is `$TEAM`"
 10 echo "path is $PATH!"
 11 echo "home is $HOME"
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章