最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
linux中shell脚本迁移压缩包
时间:2022-11-14 22:08:09 编辑:袖梨 来源:一聚教程网
原来的脚本:
| 代码如下 | 复制代码 |
| #!/bin/bash file="/root/newfile/" list="/root/sqlbak" ls -l $list/ |awk '{print $9}'|while read line do cp -r $list/$line $file done |
|
修改后的脚本:
| 代码如下 | 复制代码 |
| #!/bin/bash file="/root/newfile/" list="/root/sqlbak" ls -l $list/ |grep -v total|awk '{print $9}'|while read line do cp -r $list/$line $file done |
|
当然也有另外一个朋友给了另外一种办法:
| 代码如下 | 复制代码 |
| #!/bin/bash file="/root/newfile/" list="/root/sqlbak" for i in $list/*;do cp -r $i $newfile/;done |
|
这样让脚本执行起来更有效率.
原文来自:夜空博客 http://blog.sl**o*gra.com/post-519.html
相关文章
- 用 Electron 与 FastAPI 构建流式 Agent 对话 09-20
- JS中彻底删除JSON对象组成的数组中的元素 09-20
- JEV人工智能官网入口:Jev AI国内访问与申请教程 09-20
- 用蓝耘元生代搭建本地图库语义搜索:一句话定位目标图片 09-20
- 企业级 Agent 如何从提效走向增收:落地路径与实践解析 09-20
- Smarty的配置与高级缓存技术分享 09-20