question about testing in shell programming

In folder A i have a file "a' and text file named infile00.I would like to do redirection :a<infile01.
There is a code to do this

#get a file "a" in /home/A
for file in `ls /home/A`
do
     if [ -x file ]
     then
         #printing out if file is an execute file
         echo $file "is an execute file"
         # get an input file named input00 in /home/A
          for input in `ls /home/A`
          do
                 if [ ! -x input ]
                 then
                         home/A/$file<input
                 fi
           done
      fi
done

When i executed the script above, output was

correct is an execute
infile00 is an execute

I tried to correct the problem but.....the result did not change at all (even got worse)
Can anyone help me out.

To refer to the value of a variable, use $file with a dollar sign. (When you assign to it, there should be no dollar sign.)

You lack a slash in the innermost conditional, you want /home/A not home/A

As a matter of programming idiom, the correct way to loop over the files in a directory is simply

for file in /home/A/*

This includes the path name in the value of $file; this may or may not be what you want. To prune it off, use ${file#/home/A/}

What does it (i.e) "${file#/home/A/}" actually do? I tried with my home directory, but the variable 'file' shows empty.
What is the meaning of 'prune it off'?

Read the documentation for your shell. This construct removes the leading string after the # from the value, if present.

Suppose, the 'file' variable contains the following data:
file=/home/A/cppfiles/src

giving the command:
echo ${file#/home/A/} ==> cppfiles/src

do you mean this? Is this called "prune it off"?

File 'cmd' (executable)

#!/bin/ksh
# Get an executable file in $*

list_dir=$(ls $*)

for file in $list_dir
do
     if [ -x $file ]
     then
         #printing out if file is an execute file

         echo "File $file is an execute file"

         # get a non-executable input file in $1

          for zfile in $list_dir
          do
                 if [ ! -x $zfile ]
                 then
                        echo "File $zfile is a data file"
                        $file < $zfile
                 fi
           done
      fi
done

File 'a' (executable)

#!/bin/ksh

echo "Hello, I'm the 'a' file !"
echo "Here is my input:"

while read n
do
        echo $n
done

echo "End of file 'a'"

File 'input00' (non executable)

- this
- is
- the
- input
- of
- the
- file
- intput00

File 'input01' (non executable)

- this
- is
- the
- input
- of
- the
- file
- intput01

Execute:

./cmd A/*
File A/a is an execute file
File A/input00 is a data file
Hello, I'm the 'a' file !
Here is my input:
- this
- is
- the
- input
- of
- the
- file
- intput00
End of file 'a'
File A/input01 is a data file
Hello, I'm the 'a' file !
Here is my input:
- this
- is
- the
- input
- of
- the
- file
- intput01
End of file 'a'

:b:

It's not like that's the formal term for this, but yes, that's what I meant.