May be a simple question for experts here....
I need to get the list of files older than 30 days in the current folder. I tried "find", but it searches recursively in all the sub directories.
Can I restrict the recursive search and extract the files only from current directory ? (18 Replies)
i want to make a bash script that searches a specific pattern in files through all subdirectories beneath the current directory..without using the command grep-R
but only the command grep..
e.g
for i in *
do
grep "pattern" $i
.....
...
done
using the character (*) the script... (5 Replies)
hey,
i need to use grep to search a bunch of header files inside a directory to return which file i can find the function i'm searching for in. how do i use wild cards to search through the files? i can only figure out how to search inside the directory, not inside the files that are in the... (4 Replies)
Hi,
I am trying to write a script that will search in a particular directory and tell me how many files are in there. I then want to be able to email certain users of how many files are in that directory and what the file names are?
any help would be great as i am getting confused.
thanks (3 Replies)
I am new to shell scripting. Can someone help me out with this one please?
I need to write a script fot the following scenario:
I am currently in /parent directory.
I have a set of files in /parent/error_files directory
My script has to search for a file in /parent/erratic_files... (1 Reply)
Hi,
I am writing a shell script that finds all files named <myFile> in a directory <dir> or any of its subdirectories, recursively. I also need to take care of symbolic links that may form cycles, to avoid infinite loops.
I started writing the code but got stuck. I thought using recursion... (7 Replies)
Hi All,
requirement is to find and remove the files from sub directories but it should exclude the files from parent directory.
At present i am using the below one but it finds and remove files from both parent and sub directories.
find ${PATH} -type f \( -name securitas\* -o -name \*gz... (1 Reply)
Hi Folks ,
I have the different xml files at the following directory `/opt/app/rty/servers/tr/current/ops/config`
Let's say there are three files named
abc.xml
bv.xml
ert.xml
Now inside these xml there can be many tags as like shown below
<bean id="sdrt"... (6 Replies)
Hi All,
I've been trying to do some recursive searching but not been very successful. Can someone please help.
Scenario:
I have directory structure
/dir1/dir2/dir3/
2019/
11/
17
18
19
20
so what I want to do is run a script and as its 2019/11/18/ today it would go and only search... (3 Replies)
Discussion started by: israr75
3 Replies
LEARN ABOUT DEBIAN
strsub
STRSUB(3pub) C Programmer's Manual STRSUB(3pub)NAME
strsub - substitute first occurence of pattern with another string
SYNOPSIS
#include <publib.h>
char *strsub(char *str, const char *pat, const char *sub);
DESCRIPTION
strsub finds the first occurence of the pattern pat in the string str (using a method similar to strstr(3), i.e., no regular expressions),
and replaces it with sub. If pat does not occur in str, no substitution is made.
Of course, if sub is an empty string, the pattern is deleted from the string.
RETURN VALUE
strsub returns a pointer to the first character after the substitution, or NULL if no substitution was made.
EXAMPLE
To substitute up to two occurences of "foo" with "bar" in a line, one might do the following.
p = strsub(line, "foo", "bar");
if (p != NULL)
strsub(line, "foo", "bar");
SEE ALSO publib(3), strstr(3), strgsub(3)AUTHOR
Lars Wirzenius (lars.wirzenius@helsinki.fi)
Publib C Programmer's Manual STRSUB(3pub)