Shell Function/for In/for (())/string Concat/has dir/rename using regex/if (())/exit/execute command and pass value to Vari Able/execute python

Source: Internet
Author: User

#!/bin/bash#Remove the mer.*_ in file name is all of the files in a dirfunctionGetdir () { forElementinch' ls $`     DoDir_or_file= $"/"$element        if[-D$dir _or_file] then Getdir$dir _or_file        Else        #deal with all file in DirMv$dir _or_file' Echo$dir _or_file|sed ' s/mer.*) _//G ' fi done}#Check the input argsif(($#<1)); ThenEcho"Please input the dir of calibration images"Exitfiroot_dir= $Getdir$root _dir#Create the dir name using TimestrResult_dir="./result_of_"$ (Date +%y:%m:%d-%h:%M) echo$result _dir#if the dir doesn ' t exists, createif[!-D$result _dir];thenmkdir$result _dirfi#Execute Python programPython 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 Function/for In/for (())/string Concat/has dir/rename using regex/if (())/exit/execute command and pass value to Vari Able/execute python

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.