How can I use-x to determine the executable status of a file with spaces?

Source: Internet
Author: User
How can I use-x to determine the executable status of a file with spaces? -- Linux general technology-Linux technology and application information. For details, refer to the following section. [I = s] This post was last edited by go11 at, January 31 ,.

The Code is as follows:
CODE :#! /Bin/bash
I = 0
For file in *
Do
Filelist_test [$ I] = "$ file"
# Echo-e "$ I \ t $ {filelist_test [$ I]}"
Let I = I + 1
Done
Echo $ I
Echo "-------------------------------------"
For (j = 0; j <$ I; j ++); do
Filelist_test [$ j] = 'echo "$ {filelist_test [$ j]}" | sed's/\/G''
Echo-e "$ j \ t $ {filelist_test [$ j]}"
Done
Echo "-------------------------------------"
B = 0
For (j = 0; j <$ I; j ++); do
# Echo $ {filelist_test [$ j]}
Echo $ j
If [-f $ {filelist_test [$ j]}]; then
If [-x $ {filelist_test [$ j]}]; then
Filelist [$ j] =$ {filelist_test [$ j]} & (B ++ ))
Echo-e "$ j \ t $ {filelist_test [$ j]}"
Fi
Fi
# Echo "-------------------------------------"
Done
~

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.