Find command with MKS Toolkit

Hi All,
I want to use the find command with MKS Toolkit. I am using the below syntax,
find.exe . "pattern" -print > tmp.txt
This command is working fine in Unix, but not in MKSToolkit. But it is exiting with 1. Can any one help me how to use the find command with MKS Toolkit.
Thanks for your responses.

The proper syntax would be

find . -name "pattern" -print

Hi,

I have used this, but it is not workin. In MKSToolkit, we have to use find.exe instead of find.Similarly for all the commands. But still it is not working. Please suggest.

Actually what you are doing seems right ... Look athe man page
http://www.mkssoftware.com/docs/man1/find.1.asp

find -- find files within file tree

But there might something missing in env... Can you do find command and try to get exit code $? and compare from man page ..

The exit code is 1. And below are the various exit codes. Please help.

Possible exit status values are:

0 Successful completion.
1 Failure due to any of the following:

  • insufficient memory - invalid character specified after -type - cannot obtain information on a file for -newer - invalid permissions for -perm - cannot open a file for the -cpio option - unknown user or group name - cannot access the PATH variable - cannot execute a command specified for -exec or -ok - syntax error - stack overflow caused by an expression that is too complex 2 Invalid command line option, not enough arguments on command line, missing argument, or argument list that isn't properly terminated.

So Radhika ... Do you see any of them missing in as per the error.

Can you try following and check the error

  1. find . -print
  2. find / -print

If these also fail then you need to check your env or installation. exit code 1 means a lot ...

I guess, it is because of environment setting, i.e, it is not able to access the PATH variable. Can you help me how to set the path of the variable.

For setting env variable:
export PATH or set env PATH etc etc ... based on your shell ...

But this might not be the case ... as path will be required only when you have options like -exec or -ok (I am guessing) ..

There might be some other problem.

just try just (no print option)
$ find .

also look where the command is; and run with complete path

$which find
/usr/bin/find

then run
$ /usr/bin/find .