摘要:
001、 方法1 [root@pc1 test]# ls test.sh [root@pc1 test]# cat test.sh ## 测试程序 #!/bin/bash function join_by { ## 定义函数 local IFS="$1" ## IFS定义输入分隔符, 其中local 阅读全文
posted @ 2023-11-05 16:35
小鲨鱼2018
阅读(286)
评论(0)
推荐(0)
摘要:
linux 中 local为一个关键字,用于限制变量的作用范围(作用域),通常应用在函数的内部. 举例如下: 001、在函数内部定义变量, 不使用关键字local [root@pc1 test2]# ls a.sh [root@pc1 test2]# cat a.sh ## 测试函数 #/bin/b 阅读全文
posted @ 2023-11-05 16:06
小鲨鱼2018
阅读(2372)
评论(0)
推荐(0)
摘要:
001、 创建数组 a、方法1 [root@pc1 test01]# ay1=(100 200 "abc" "xyz") ## 创建数组 b、方法2 [root@pc1 test01]# ay2[0]=100 [root@pc1 test01]# ay2[1]=200 [root@pc1 test0 阅读全文
posted @ 2023-11-05 10:40
小鲨鱼2018
阅读(704)
评论(0)
推荐(0)

浙公网安备 33010602011771号