标签: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
标签:shell脚本
原文地址:http://blog.51cto.com/akui2521/2092461