Common Linux shell Script records

Source: Internet
Author: User

Traverse directory where all files are directories or files

 for file  in. /* do    if test-f $file    then        echo $file is the file    fi    if test-d $file then        echo $file is the directory    Fidone
Filelist= 'ls./Proto 'Echo$filelist for  file inch$filelist; Do#不能有判断if [-F $file], why? Because the file is in the current directory proto directory, we filelist output is the file list, no path,-F X.proto X.proto is not in the current directory, it must be false,if forever false, plus the path to true,if [-F./proto/$                File];then so you can. #protoc-i=proto--cpp_out=CPP/proto/Clientgate.proto Protoc-i=proto--cpp_out=CPP/proto/$file# Protoc-i=proto-olua/$ (basename$file. Proto). PB proto/$file Done~ ~
protoc-i= $SRC _dir--cpp_out= $DST _dir $SRC _dir/addressbook.proto


Common Linux shell Script records

Related Article

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.