详细的教程这里有:
https://www.runoob.com/linux/linux-shell-basic-operators.html
一、脚本运算
这里贴上运行的脚本:
! /bin/bash
adate=date +%d
echo $adate
atwo=2
aexcu=expr $adate % $atwo
echo $aexcu
if [ $aexcu != $atwo ]
then
echo "same"
fi
mynumber=6
mynumber1=6
echo $mynumber
mynumber3=expr $mynumber + $mynumber1
echo $mynumber3
echo "done"
运行结果:
二、PM2 启动管理
1、直接执行下面脚本:pm2 start ecosystem.config.js
2、ecosystem.config.js的内容如下
module.exports = {
apps : [{
name: 'xxxxxx',
exec_mode: 'fork',
script: './node_modules/nuxt/bin/nuxt.js',
args: 'start',
env: {
NODE_ENV: 'testing',
HOST: '0.0.0.0',
PORT: 3088,
},
}],
};