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 ...
随机推荐
- excel增加上一列的数值(日期)
=TEXT(D2-1,"m月d日") 有年的话就是 =TEXT(D2-1,"yyyy年m月d日") D2就是参照日期
- OpenGL数据类型及相应C数据类型
- Jquery学习笔记(8)--京东导航菜单(2)增加弹框
京东导航,添加中间的弹框栏,使用position定位,放在左侧栏的li标签里面,成为一个整体,保证鼠标在弹框里的时候,弹框不消失: <!DOCTYPE html> <html lan ...
- centos单机安装Hadoop2.6
一,安装环境 硬件:虚拟机 操作系统:Centos 6.4 64位 IP:10.51.121.10 主机名:datanode-4 安装用户:root 二,安装JDK 安装JDK1.6或者以上版本.这里 ...
- 最纯粹的直播技术实战02-Camera的处理以及推流
最纯粹的直播技术实战02-Camera的处理以及推流 最新实战教程.Android自己主动化刷量.作弊与防作弊.案例:刷友盟统计.批量注冊苹果帐号 这个系列的文章将会研究最纯粹的Android直播的实 ...
- 微信小程序1 - 扩展app.js
常规的开发过程中, 每个Page的逻辑中,要使用 util.js WapRequest.js, 需要在每个页面中书写 require('/utils/WapRequest'); 略繁琐 在app. ...
- css3 一个简单的静态立方体
<meta charset="utf8"> <style> .cube { position: absolute; left: 50%; top: 250p ...
- 【BZOJ】3668: [Noi2014]起床困难综合症(暴力)
http://www.lydsy.com/JudgeOnline/problem.php?id=3668 这题很简单.............. 枚举每一位然后累计即可.. QAQ,第一次以为能1A, ...
- The Boost C++ Libraries中文教程
http://zh.highscore.de/cpp/boost/
- MANIFEST.MF 文件内容完全详解
http://blog.csdn.net/zhifeiyu2008/article/details/8829637