shell
好好好你说的都对
这个作者很懒,什么都没留下…
展开
-
以空格分割文件每行数据并写入数组
#!/bin/bash filename=$1 j=0 while read line do i=1 while : do str=` echo $line | cut -d " " -f $i ` if [ "$str" == "$line" ];then arr[j]=$str break elif [ "$str" != "" ];then arr[j]=$...原创 2020-08-07 16:58:16 · 692 阅读 · 0 评论 -
shell-scp分发文件夹下所有文件到多台服务器
#!/usr/bin/expect -f #chmod 777 distribute_file.sh #把所有目的ip写入ipfile.txt文件,ipfile.txt文件与distribute_file.sh在同一层目录,ipfile.txt文件中一行写一个ip #sh distribute_file.sh 源服务器路径 目的服务器路径 #例如:sh distribute_file.sh /...原创 2018-08-03 18:20:11 · 4443 阅读 · 1 评论 -
shell常用命令-自用
1.ssh免密: -o StrictHostKeyChecking=no 避免第一次登录出现公钥检查。也就是避免出现 例如: scp -o StrictHostKeyChecking=no $bakpathfrom:/$bakpath/$homebak/${day}/${day}.zip /$bakpath/$homebak/${day}/ sshpass 参数 SSH命令(ss...原创 2018-10-31 11:20:59 · 459 阅读 · 0 评论