1st...don't use find unless you use it only on your own machine... find does not work as expected on other distros or even it isn't installed (not a LSB specific command)
2nd: did you
ever read the manual? Cmd$ is NOT the returned output of your command.. if you use it in this way, you'll get a compiler error (trying to write a numeric value....)
3rd:
which Version of PB do you use as this is
important for Runprogram as there are
essential changes from 3.94 to 4.00 (and so for the help to give...

)
If it's V4.00 (beta), try this:
Code: Select all
filename.s="find"
startpoint.s="/usr/bin"
mypgm= RunProgram("ls", "-A -l -R "+startpoint.s,"",#PB_Program_Read|#PB_Program_Open)
While ProgramRunning(mypgm)
li.s=ReadProgramString(mypgm)
If FindString(li,filename,1)
output$ + li.s +#LF$
EndIf
Wend
Trim(output$)
While Right(output$,1)=#LF$
output$=Left(output$,Len(output$)-1)
Wend
Debug output$
modify it as you want... insted of using a variable you can direct the output to your editor gadget... for the parameters of the ls-command.... see the apropriate manual (
man ls)
4th: Pseudo-code doesn't help much in most cases... posting a snippet, demonstrating the problem is much better (and no one has tp guess your problem...

)