統計計算機的軟硬件信息腳本
阿新 • • 發佈:2018-03-29
shell腳本
[root@akuilinux01 shellXT]# cat env.sh
#!/bin/bash
#使用變量替換定義若幹個變量
TIME=`date`
NAME=`uname -n`
KERNEL=`uname -s`
VERSION=`uname -r`
ARCH=`uname -m`
OS=`uname -o`
echo
echo "========================================="
echo "Current Time: $TIME"
echo "Host Name: $NAME"
echo "Operating System: $OS"
echo "Computer ARCH: $ARCH"
echo "Kernel Version: $KENNEL$VERSION"
echo
exit 0
[root@akuilinux01 shellXT]# sh env.sh
=========================================
Current Time: 2018年 03月 29日 星期四 15:00:56 CST
Host Name: akuilinux01
Operating System: GNU/Linux
Computer ARCH: x86_64
Kernel Version: 3.10.0-693.el7.x86_64
統計計算機的軟硬件信息腳本