Skip to content
Advertisement

Tag: recursion

How to grep recursively and ignore subdirectories of subdirectories?

I am already familiar with grep -r “searchTerm” . and I am familiar with grep -r “searchTerm” exclude={subdir1, subdir2} . However, I am looking for a way to grep recursively, through subdirectories and ignore certain subdirectories of subdirectories. For example, if the directory structure is as follows: How would I be able to exclude idc and otherStuffIdc, since these folders

Complex regular subexpression recursion limit (32766) exceeded at

I have a perl script which performs a pgrep as follows: However when launch the script am having the following error/warning: Complex regular subexpression recursion limit (32766) exceeded at /home/k.sewnundun/test.pl line 16. Complex regular subexpression recursion limit (32766) exceeded at /home/k.sewnundun/test.pl line 16. Please find below the debug: What could be the issue? Thanks Answer This is a good sign

Copy and replace file recursively

I try to find a way to copy and replace files recursively. Example: Folder /home/test/ You can see that in folder /home/test I have more and more folders (1,2,3,4) which file name ‘test.jpg’. I have a file /home/test.jpg Question: How to replace file ‘test.jpg’ in 1/2/3/4(folders) with file /home/test.jpg ? Answer With find, you could do:

Recursion using main() function [closed]

It’s difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago. I am writing a program to calculate factorial using recursion of main() function.

Advertisement