In which "Best1" is the product name and "ls /opt/bmc/Patrol3/*/best1" is the way to find the product version of Best1 in that particular server.
Now what i need is to run the second part(ls /opt/bmc/Patrol3/*/best1) in the server and forward output with corresponding product name to a file. The output file should look like
Product_name Version
Best1 3.0.1
Loganame 1.0
..... ...
.... ...
Be careful about security here. A script like that would allow anyone with access to the datafile to have any command executed as the user who runs the script.