shell function/for in/for (())/string concat/has dir/rename using regex/if(())/exit/execute command and pass value to variable/execute python
#!/bin/bash #remove the MER.*_ in file name for all the files in a dir
function getdir(){
for element in `ls $1`
do
dir_or_file=$1"/"$element
if [ -d $dir_or_file ]
then
getdir $dir_or_file
else
#deal with each file in dir
mv $dir_or_file `echo $dir_or_file|sed 's/MER.*)_//g'`
fi
done
} #check the input args
if (($#<1));then
echo "please input the dir of calibration images"
exit
fi root_dir=$1
getdir $root_dir #create the dir name using timestr
result_dir="./result_of_"$(date +%Y:%m:%d-%H:%M) echo $result_dir #if the dir doesn't exists, create
if [ ! -d $result_dir ];then
mkdir $result_dir
fi # execute python program
python zss_calibrateFrom_whole_dir.py $root_dir $result_dir ##########################
#for i in 4 7
#for((i=0;i<10;i++));
#do
#echo $i
#for file in `ls ./cali-8-14-18/"$i"/*.png`
#do
#mv $file `echo $file|sed 's/MER.*)_//g'`
#done;
#done;
注意:shell脚本中的空格
参考:
比较字符串
https://www.jb51.net/article/56559.htm
if then elif then else fi用法
https://blog.csdn.net/m0_37138008/article/details/72814543
shell function/for in/for (())/string concat/has dir/rename using regex/if(())/exit/execute command and pass value to variable/execute python的更多相关文章
- string.Join和string.Concat的区别
源自Difference between String.Join() vs String.Concat() With .NET 4.0, String.Join() uses StringBuilde ...
- 声明:function FileSetAttr ( const FileName : string
对文件和文件夹都有效 FileSetAttr('D:\Administrator\Desktop\patcher\Win32\Release\config\element\update',faHid ...
- 关于String.concat()方法和StringBuffer.append()方法的学习:方法是如何追加字符到源字符串的
问题分析: 首先,看看两段代码的运行结果,两段代码分别是: 第一段代码,关于String.concat()方法的测试: public static void main(String[] args) { ...
- String+ String.Concat String.Format StringBuilder 之间的性能测试
找到一篇国外的代码,专门来测试这个, String+ String.Concat String.Format StringBuilder 前三个在100个左右字符串差不多, String.Concat ...
- StringBuilder String string.Concat 字符串拼接速度再议
首先看测试代码: public class StringSpeedTest { "; public string StringAdd(int count) { string str = st ...
- StringBuilder String string.Concat 字符串拼接速度
首先看测试代码: public class StringSpeedTest { "; public string StringAdd(int count) { string str = st ...
- java String、String.concat和StringBuilder性能对比
看到网上有人已经做过对比,并且贴出了代码,然后我运行了之后发现跟我分析的结论差距很大.发现他的代码有个问题,UUID.randomUUID() 首次调用耗时会很高,这个耗时被计算给了String,这对 ...
- C# 字符串拼接性能探索 c#中+、string.Concat、string.Format、StringBuilder.Append四种方式进行字符串拼接时的性能
本文通过ANTS Memory Profiler工具探索c#中+.string.Concat.string.Format.StringBuilder.Append四种方式进行字符串拼接时的性能. 本文 ...
- Unable to execute command or shell on remote system: Failed to Execute process
1.问题描述 先说下我的项目环境:jenkins部署在windows下面,项目部署也是在windows下面,ssh服务器是FreeSSHd,原来是打算用Send files or execute co ...
随机推荐
- 本地测试Tomcat配置Https访问
一.tomcat开启HTTPS配置 1) 准备证书 使用jdk工具keytool生成一个ssl测试用证书, 一路按照提示操作输入即可 keytool -genkey -alias tomcat -ke ...
- Powershell对象选择,排序和变量存储
PowerShell基础教程(17)——对象的选择.排序和变量存储 可以使用 Select-Object cmdlet 来创建新的.自定义的 Windows PowerShell 对象,后者包含的属性 ...
- vue render函数
基础 vue推荐在绝大多数情况下使用template来创建你的html.然而在一些场景中,你真的需要javascript的完全编程能力.这就是render函数.它比template更接近编译器 < ...
- java printf long
System.out.printf("%d\n", 1000000000000000000L);
- invalid comparison: java.util.ArrayList and java.lang.String——bug解决办法
今天碰到个问题,解决了很久才搞定,来记录下,希望可以帮助到大家 贴错误源码: 这是一个根据list集合的查找数据的 sql,在接收list的时候加了判断 list != ‘ ’ “”,引起了集合与St ...
- 一种480 MHz无线数传模块的设计
一种480 MHz无线数传模块的设计 来源:电子技术应用2012年第6期 作者:严 冬,黄 聃,王 平,彭 杰,朱柏寒2012/8/13 16:56:32 关键词: 微处理器|微控制器 物联网 RF ...
- C#高级学习群欢迎你(群号 128874886)
C#高级学习群,有着C# ,Asp.net ,Wpf等技术经验相当丰富的工程师,秉承着刘群主开源共享的精神,为新手和高手们提供了良好的学习交流平台,自创群以来,为群员解决了不少的技术难题,大大提高了学 ...
- import _mysql----ImportError: DLL load failed: %1 不是有效的 Win32 应用程序。
背景:安装了mysql,练习sql 操作,提示 ImportError DLL load failed: %1 不是有效的 Win32 应用程序 解决方法: 操作系统win10,64位,查看安装的my ...
- HTML5课程
1.新语义化标签:section.header.footer.nav.article.aside.figure.dialog.time.meter.mark.progress.video 2.最新的属 ...
- IntelliJ IDEA 注册码-使用帮助
拷贝自http://idea.lanyus.com,但是内容有些老旧,有空了我更新一下. 激活 激活码激活 授权服务器激活 破解补丁激活 修改试用时间 激活码 激活码目前为博主分享的自用激活码,到期前 ...