
shell study-15day–shell函数
1、函数的使用 函数是一个脚本代码块,你可以对它进行自定义命名,并且可以在脚本中任意位置使用这个函数,要使用这个函数,只要使用这个函数名称就可以了。使用函数的好处:模块化,代码可读性强。 (1)函数创建语法 方法 1: function n...

1、函数的使用 函数是一个脚本代码块,你可以对它进行自定义命名,并且可以在脚本中任意位置使用这个函数,要使用这个函数,只要使用这个函数名称就可以了。使用函数的好处:模块化,代码可读性强。 (1)函数创建语法 方法 1: function n...

go shell执行优化版+ 输出结果为table格式 package mainimport (\"fmt\"\"github.com/modood/table\"\"golang.org/x/crypto/ssh\"\"io/ioutil...

建议在用户家目录创建.vimrc文件:文件格式如下: set ignorecaseset autoindentset pasteautocmd BufNewFile *.sh exec \":.call SetTitle()\"func S...

#!/bin/bash# logs# 2018/2/2 yengPATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/binexport PATHcheck_...

#!/bin/bash# name:enerpres shell first chapters.# time:2019/3/30# author:yeng# compary:XXXXX集团有限公司PATH=/bin:/sbin:/usr/b...

代码:[root@test sh]# cat ping.sh#!/bin/bashfor START in (seq024)doIP=\”192.168.1.(seq 0 24)doIP=\”192.168.1.(s...

for循环:while循环:

for循环:while循环:

cpu: 代码: #!/bin/bashif [ uname != “Linux” ];thenecho “操作系统不是Linux.”exit 1fiwhich vmstat &>/dev/nullif [ $? -ne 0 ...

bash数学运算 1.expr $num1 operator $num2 ~$ num1=2~$ num2=4~$ expr $num1 > num2~$ expr $num1 \\> num20~$ expr $num1 + ...