随笔分类 - shell
摘要:sed 删除换行符 sed ':label;N;s/\n/:/;b label' filename sed ':label;N;s/\n/:/;t label' filename 上面的两条命令可以实现将文件中的所有换行符替换为指定的字串,如命令中的冒号。命令的解释: :label; 这是一个标签,
阅读全文
摘要:#!/bin/bash #cp remaining_for_clearing.manifest_bak remaining_for_clearing.manifest cat s2l2-standalone.manifest |awk -F "|" '{print $1 "|" $2}' > S2L
阅读全文
摘要:secur1ty@localhost:/tmp/test2$ cat test.txt adduser 3.118 apt 2.2.4 apt-transport-https 2.2.4 base-files 11.1+deb11u3 base-passwd 3.5.51 bash 5.1-2+b3
阅读全文
摘要:for i in cat tesst.txt do echo -e "第一行\n第二行\n第三行\n第四行\n" | ./ldapmodify -d "cn=root" -w password done
阅读全文
摘要:1. for循环 #!/bin/bash a=0 for ((i=0 ; i <= 100; i++ )) do a=$((a+i)) done echo $a 2. awk语句 [root@localhost ~]# awk 'BEGIN { for(i=1; i<=100; i++) sum+=
阅读全文

浙公网安备 33010602011771号