I am sorry, you confused me a bit by the way you wrote the find-command .
If I am not mistaken, the correct syntax for the find-command is:
find /folder -name 'filename_and_or_wildcard'
So in your case, it would be:
find /usr/sap/test1 -name 'TEST*'
Or as of your notation:
/bin/sh -c "find /usr/sap/test1 -name 'TEST*'"
Calling this from a script in DS:
exec('/bin/sh -c "find /usr/sap/test1 -name \'TEST*\'"',8);
Or when you put the filename prefix in a global variable:
$variable = 'TEST*';
exec('/bin/sh -c "find /usr/sap/test1 -name {{$variable}"',8);
Good practice when developing script is inserting some debugging statements, like
print('/bin/sh -c "find /usr/sap/test1 -name {{$variable}"');
The trace file will show the generated command:
/bin/sh -c "find /usr/sap/test1 -name 'TEST*'"
If the command fails, you can copy-and-paste it into your Linux command line and run it manually. That may give you a better understanding of the reason why.