Guys,
I need to find all the files ending with either dmp or dmp.Z. This command is giving me error.
@files =`find $path \(-name ".dmp" -o -name ".dmp.Z"\) -mtime +30`;
sh: 0403-057 Syntax error at line 1 : `(' is not expected.
Thanks in advance
Guys,
I need to find all the files ending with either dmp or dmp.Z. This command is giving me error.
@files =`find $path \(-name ".dmp" -o -name ".dmp.Z"\) -mtime +30`;
sh: 0403-057 Syntax error at line 1 : `(' is not expected.
Thanks in advance
You need to double the backslashes in order for them to be passed through to the shell. Backticks in Perl undergo "double-quotish" substitution so one level of backslashes gets eaten by Perl, basically.
Thanks era,
You mean like this.
@files =`find $path \\(-name ".dmp" -o -name ".dmp.Z"\\) -mtime +30`;
This is not working either.
If you copy+pasted that verbatim then the error message "find: invalid predicate `(-name'" should be self-explanatory -- you need a space in between there. Also before the closing paren.

cool. It is working now.
@files =`find $path \\( -name ".dmp" -o -name ".dmp.Z" \\) -mtime +30`;
Thanks a lot era.