04 2021 档案
摘要:date用法 date格式选项 格式 含义 %Y(y) 年 %B(b) 月 %D(d) 日 %A(a) 工作日 %H 时 %M 分 %S 秒 %N 纳秒 %s unix纪元时 格式化时间显示 date "+%H-%M-%S" date timestamp function timeconvert()
阅读全文
摘要:bash heredoc reference article 最后一行标识符不能有空格 heredoc multi line comment << tips hello world tips echo hello lina heredoc cat message cat << tips hello
阅读全文
摘要:bash特殊变量 变量 含义 0函数名\(n|n>=1,表示第一个、第二个、第n个参数、\)(10)@ 全部参数 ∗全部参数# 参数个数 上一个命令的最后一个参数当前shell进程ID? 上一个命令的返回值 function test() { for i in
阅读全文
摘要:CENTRAL STRING function central_line() { #输入字符串长度 str_length={#1} #echo{str_length} #中心线长度 line_length=(((120−{str_length}) / 2 )) #echo ${line_
阅读全文
摘要:bash调用串行任务队列方法和干预 将任务填写在task_list以数组的形式组织 for循环一步步的执行串行任务 某个任务需要依靠外部条件触发执行,monitor监测需要的文件 task_list=(task1 task2 task3) function monitor() { until tes
阅读全文
摘要:BASH loewrcase and uppercase convert reference article tr echo "hello world" | tr 'a-z' 'A-Z' or echo "hello world" | tr '[:lower:]' '[:upper:]' # [:a
阅读全文
摘要:bash数组array[*]、array[@]、"array[*]"、"array[@]" matrix=("hi" "hello world" "1 2 3") for item in matrix[∗];doecho{item} done echo " " for item in $
阅读全文
摘要:bash提示符前景颜色 \e[ ——表示颜色的提示的起始位置 x;ym ——表示颜色的代码。颜色的代码在下面有说明 \e[m ——表示代颜色的提示的结束位置 echo -e "\e[0;31m linus linux macos \e[0m" #Black 0;30 Dark Gray 1;30 #
阅读全文
摘要:repete print printf "=%0.s" {1..20} num=`printf "=%0.s" {1..20}` echo -e "\n${#num}\n" repete print number as a variable num=30 eval printf "=%0.s" {1
阅读全文
摘要:VIM CHEAT SHEET 感谢skywind前辈同意转载他的劳动成果 原始档案github地址 ############################################################################## # VIM CHEATSHEET (中文
阅读全文
摘要:BASH CHEAT SHEET 感谢skywind前辈同意转载他的劳动成果 原始档案github地址 ############################################################################## # BASH CHEATSHEET (
阅读全文