Background: the name of a folder there are a number of similar documents, such as pi_1_0 pi_2_0 pi_3_1... ,
Objective: shell script implementation will find all the documents folder, in another folder to create a name is processed by the corresponding documents, such as find pi_1_1, corresponding is also processed pi_1_1;
Problem: when I was inside the folder to find the document file name contains variables, shell script can't identify,
For ((I=0; i<255; I++))
Do
For ((j=0; J<255; J++))
Do
If [-e bin/pi_ $i_ $j_]; Then # variables included here, I met problems in
# # #
Fi
The done
The done
I tried this:
For ((I=0; i<255; I++))
Do
For ((j=0; J<255; J++))
Do
B="pi_ $i_ $j # will make variable expansion in double quotation marks
If [-e bin/$b_]; Then
# # #
Fi
The done
The done
But still won't do, how should deal with to my purpose?
CodePudding user response:
If [-e bin/pi_ $i_ $j_]; Then this place into aIf [-e bin/pi_ ${I} ${j} _ _]; Then have a try
CodePudding user response:
And $I $j value is not the same, does not need to be nested, cut a nestedCodePudding user response: