Unix Find command

John

Member
Hello Team,

I need help on following requirement:

I need to search a file "mydoc.pdf" in unix directory "/home/sk" by using Unix command "find".

Please let me know how to use unix command for this in Progress code.

Regards
 

TomBascom

Curmudgeon
Something like this should do the trick:

Code:
define variable fName as character no-undo format "x(60)".
input through value( 'find /home/sk -name "mydoc.pdf" -print' ).
repeat:
  import unformatted fName.
  display fName.
end.
Presumably you need to use "find" because the file is somewhere in the directory tree beneath /home/sk? Otherwise, if it is just the one file and in /home/sk/mydoc.pdf you would be better off using:

Code:
file-info:file-name = "/home/sk/mydoc.pdf".
if file-info:full-pathname = ? then
  message "no such file".
 else
  message file-info:full-pathname.
 
Top