Linux下共通shell的制作

#!bin/sh
#共通shell

#共通函数
commonMethod(){
echo commonMethod
}

#共通变量
COMMON="COMMON"

#可以不写
export COMMON

调用方法

#!bin/sh

#共通函数路径
. /home/common.sh

#读取共通变量
echo $COMMON

#调用共通函数
commonMethod

原文地址:https://www.cnblogs.com/aggavara/p/2779483.html