linux简单shell编程

一、乐透宝

#!/bin/bash

myNum=23123
lotNumMax=$RANDOM

echo  "Result:"
echo  "Your Num: $myNum"
echo  "Luckly Num: $lotNumMax"
if [[ $myNum -lt $lotNumMax ]];
then
    echo "Your Win!"
else
    echo "Your Lost!"
fi

二、批量安装

#!/bin/bash
sudo apt -y install htop
sudo apt -y install iotop
sudo apt -y install iftop