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
~ |