my_functions.inc
----------------
#! /bin/sh
f_echo() {
echo "$1"
return 0
}
test.sh
-------
#! /bin/sh
. ./my_functions.inc
f_echo "Hello!"
chmod +x my_functions.inc test.sh
./test.sh
shell之外部函数调用
最新推荐文章于 2024-07-15 08:14:14 发布
my_functions.inc
----------------
#! /bin/sh
f_echo() {
echo "$1"
return 0
}
test.sh
-------
#! /bin/sh
. ./my_functions.inc
f_echo "Hello!"
chmod +x my_functions.inc test.sh
./test.sh