#!/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的更多相关文章

  1. string.Join和string.Concat的区别

    源自Difference between String.Join() vs String.Concat() With .NET 4.0, String.Join() uses StringBuilde ...

  2. 声明:function FileSetAttr ( const FileName : string

    对文件和文件夹都有效  FileSetAttr('D:\Administrator\Desktop\patcher\Win32\Release\config\element\update',faHid ...

  3. 关于String.concat()方法和StringBuffer.append()方法的学习:方法是如何追加字符到源字符串的

    问题分析: 首先,看看两段代码的运行结果,两段代码分别是: 第一段代码,关于String.concat()方法的测试: public static void main(String[] args) { ...

  4. String+ String.Concat String.Format StringBuilder 之间的性能测试

    找到一篇国外的代码,专门来测试这个, String+ String.Concat String.Format StringBuilder 前三个在100个左右字符串差不多, String.Concat ...

  5. StringBuilder String string.Concat 字符串拼接速度再议

    首先看测试代码: public class StringSpeedTest { "; public string StringAdd(int count) { string str = st ...

  6. StringBuilder String string.Concat 字符串拼接速度

    首先看测试代码: public class StringSpeedTest { "; public string StringAdd(int count) { string str = st ...

  7. java String、String.concat和StringBuilder性能对比

    看到网上有人已经做过对比,并且贴出了代码,然后我运行了之后发现跟我分析的结论差距很大.发现他的代码有个问题,UUID.randomUUID() 首次调用耗时会很高,这个耗时被计算给了String,这对 ...

  8. C# 字符串拼接性能探索 c#中+、string.Concat、string.Format、StringBuilder.Append四种方式进行字符串拼接时的性能

    本文通过ANTS Memory Profiler工具探索c#中+.string.Concat.string.Format.StringBuilder.Append四种方式进行字符串拼接时的性能. 本文 ...

  9. Unable to execute command or shell on remote system: Failed to Execute process

    1.问题描述 先说下我的项目环境:jenkins部署在windows下面,项目部署也是在windows下面,ssh服务器是FreeSSHd,原来是打算用Send files or execute co ...

随机推荐

  1. LayerMask小结

    layerMask参数: Raycast (ray : Ray, out hitInfo : RaycastHit, distance : float = Mathf.Infinity, layerM ...

  2. python操作sqlserver

    # coding=gbk import sys   import pymssql #尝试数据库连接 try:     conn = pymssql.connect(host="192.168 ...

  3. 接口测试脚本之Jsoup解析HTML

    第一次接触jsoup还是在处理收货地址的时候,当时在写一个下单流程,需要省市区id以及详细门牌号等等,因此同事介绍了jsoup,闲来无事,在此闲扯一番! 1.我们来看下,什么是jsoup,先来看看官方 ...

  4. oracle instant client,tnsping,tnsnames.ora和ORACLE_HOME

    前段时间要远程连接oracle数据库,可是又不想在自己电脑上完整安装oracleclient,于是到oracle官网下载了轻量级clientinstant client. 这玩意没有图形界面,全靠sq ...

  5. POJ 2472 106 miles to Chicago

    最短路问题变形. 题意是给你一些道路,和路过时不被抓的概率. 要求找一条到达目的地时不被抓的最大概率概率. 初始 dis[]设为 1 .其余为 0 .找最大就可以. #include<cstdi ...

  6. 在项目中用过Spring的哪些方面?及用过哪些Ajax框架?

    在项目中用过Spring的哪些方面?及用过哪些Ajax框架? 解答:在项目使用过Spring IOC ,AOP,DAO,ORM,还有上下文环境. 在项目使用过Ext,Juery等Ajax框架.

  7. AWT提供了Java Applet 和Java Application中可用的用户图形界面 GUI 中的基本组件

    AWT提供了Java Applet 和Java Application中可用的用户图形界面 GUI 中的基本组件( component s). 由于Java是一种独立于平台的 程序设计语言 ,但GUI ...

  8. 设置select选中某个option

    <select class="selector"></select> 1.设置value为pxx的项选中 $(".selector"). ...

  9. VC++Debug查看堆对象内容,即使符号已经超出作用范围

    Sometimes you'd like to watch the value of an object (on the heap) even after the symbol goes of sco ...

  10. EF提供的3中查询方式

    1. Linq to Entities using (TestEntities te = new TestEntities()) { var user = from a in te.User wher ...