1.命令行函数
function show_system{
echo “the time is”
uptime
echo
}
show_system
2.运行在文件中的函数
#!bin/bash
vim test.txt
function show_system{
echo “the time is”
uptime
echo
}
show_system
sudo chmod ./test.txt

带有return的函数
fun(){
return 99
}
fun
echo $?

shell函数
最新推荐文章于 2024-12-03 22:09:39 发布
979

被折叠的 条评论
为什么被折叠?



