#!/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. Atitit.md5 实现原理

    Atitit.md5 实现原理 1. 算法流程图2 2. MD5算法过程:2 2.1. 3. 处理分组数据3 3. MD5加密字符串实例5 4. Md5的历史7 4.1.1. MD27 4.1.2. ...

  2. ListView局部更新(非notifyDataSetChanged)

    package com.example.test; import java.util.ArrayList; import java.util.List; import android.app.Acti ...

  3. 斑马Zebra ZPLII指令集中文说明解释

      我们最常用的斑马(Zebra)条码打印机,应用ZPLII命令来控制打印,说明书中有每条指令的详细说明及相关示例,下面是各指令的中文释义: ^A 对Zebra内置点阵字体缩放 ^A(可缩放/点阵字体 ...

  4. redis数据类型[string 、list 、 set 、sorted set 、hash]

    1. Keys  redis本质上一个key-value db,所以我们首先来看看他的key.  首先key也是字符串类型,但是key中不能包括边界字符:由于key不是binary safe的字符串, ...

  5. mysql查询条件字段值末尾有空格的问题

    mark MYSQL的binary解决mysql数据大小写敏感问题的方法

  6. chpasswd 更简单的更改密码的方式

    [root@m01 .ssh]# useradd test[root@m01 .ssh]# echo "test:123"|chpasswd Linux命令:chpasswd 批量 ...

  7. android Bitmap用法总结(转载)

    Bitmap用法总结1.Drawable → Bitmappublic static Bitmap drawableToBitmap(Drawable drawable) {Bitmap bitmap ...

  8. 【C++自我精讲】基础系列三 重载

    [C++自我精讲]基础系列三 重载 0 前言 分二部分:函数重载,操作符重载. 1 函数重载 函数重载:指在同一名字空间中,函数名称相同,参数类型.顺序或数量不同的一类函数,同一函数名的函数能完成不同 ...

  9. Hourrank 21 Tree Isomorphism 树hash

    https://www.hackerrank.com/contests/hourrank-21/challenges/tree-isomorphism 题目大意: 给出一棵树, 求有多少本质不同的子树 ...

  10. 对Linux命令进一步学习vim(二)

    今天,进一步学习Linux相关的命令,可能会有重复的地方,但学习本来就是不断重复的过程.故作小记! 1.安装了:vim  ,,,一款Linux爱好者经常用到的ide sudo apt-get inst ...