题目: 编写个shell脚本将当前目录下大于10K的文件转移到/tmp目录下。 答案: #!/bin/bash for FileName in `ls -l | awk '$5>10240 {print $9}'`; do mv $FileName /tmp done ls -al /tmp ...
分类:
系统相关 时间:
2020-01-05 16:05:53
阅读次数:
83
第二天:1.while循环,例 #!/bin/bashi=1sum=0while [ i -lt 100 ]do ((i++)) sum=$sum+$idone2.函数hello(){ echo "hello" }调用函数:hello不需要括号3.函数传递参数hello(){echo "diyige ...
分类:
系统相关 时间:
2020-01-04 12:38:31
阅读次数:
82
shell 循环语句for/do/done和while/do/done以及break,continue https://blog.csdn.net/weixin_38280090/article/details/81843264 原创舌耳 发布于2018-08-19 22:58:17 阅读数 150 ...
分类:
系统相关 时间:
2020-01-04 12:28:55
阅读次数:
111
第八课while循环#coding:utf-8#while循环#当布尔表达式为True,就是执行一遍循环体中的代码。‘‘‘现在要从1输出到10print(1)print(2)print(3)print(4)print(5)print(6)print(7)print(8)print(9)print(10)‘‘‘‘‘‘whilecondition_expression:statement1statem
分类:
其他好文 时间:
2020-01-03 15:40:47
阅读次数:
86
我的项目使用的是Spring Boot,Spring Data JPA 其中Spring已经封装好了事务,在注解@Transactional中,自动执行事务,出异常自动回滚,但在使用的时候会遇到一些问题: 在多个方法中使用@Transactional,其中一个方法运行时候报错,但是数据却插进去了,但 ...
分类:
其他好文 时间:
2020-01-03 14:23:17
阅读次数:
98
mysql官方提供了一个用界面安装mysql的方法,我不想使用。既然mac也是unix系统,那么,用unix的那一套安装思路也是通行的。可是,我又不想将其安装在/usr/local/mysql,我想电脑是我的,我想把它安装在哪里,我就安装在哪里,毕竟,mysqld不也是一个程序而已。 下面记录一下我 ...
分类:
数据库 时间:
2020-01-01 23:42:36
阅读次数:
175
1.打印形状 1 #!/bin/bash 2 # 打印等腰三角形 3 read -p "Please input the length: " n 4 for i in `seq 1 $n` 5 do 6 for ((j=$n;j>i;j--)) 7 do 8 echo -n " " 9 done 1 ...
分类:
系统相关 时间:
2020-01-01 09:42:33
阅读次数:
82
介绍 在Python中,使用多线程multi threading可以『同时』执行多个任务,比如你需要一个线程来复制读取信息,另一个线程来解析。为什么这里的同时要加引号呢,这是由于Python中GIL,也就是全局锁,看似同时执行多个任务,实际上是分布执行的,只不过各自完成不同的任务会提高工作效率。如果 ...
分类:
编程语言 时间:
2019-12-30 21:18:16
阅读次数:
75
for循环格式 1. 直接赋值 for i in 1 3 5 2. 命令赋值 for i in 3. 赋值一个字符串 for i in my name is haha 4. for ((i=1;i0;n++,m )) do echo "$n $m" done ``` ...
分类:
系统相关 时间:
2019-12-30 14:39:05
阅读次数:
75