Hi all experts,
here is a problem which i would appreciate ur expertise.
I need to do this:
Eg.
Find a number: 1234567 which i dunno which file and which folder
I do know which main folder it is in but it is hidden deep within a lot of subdir.
Is it possible to find the file? + output... (4 Replies)
Hi,
I have a challenging task,in which i have to find the duplicate files by its name and size,then i need to take anyone of the file.Then i need to open the file and find for more than one pattern and count of that pattern.
Note:These are the samples of two files,but i can have more... (2 Replies)
Hi,
I have a file with 3 columns and I want to find when the average number of rows on column 3 is a certain value. The output will be put into another file indicating the range.
Here is what I mean (file is tab separated):
hhm1 2 0
hhm1 4 0.5
hhm1 6 0.3
hhm1 8 -1.4... (2 Replies)
In a directory, there are two different file extensions (*.txt and *.xyz) having similar names of numerical strings (*). The (*.txt) contains 5000 multiple files and the (*.xyz) also contains 5000 multiple files. Each of the files has around 4000 rows and 8 columns, with several unique string... (5 Replies)
I an trying to parse a file looking for pattern1, or pattern2, or pattern3 and when found print that line and the next 4 lines after it. I am using korn shell script on AIX and grep -A isn't available. (1 Reply)
I have a file name in $f. If $f has "-" at the beginning, or "=", or does not have extension ".ry" or ".xt" or ".dat" then cerr would not be empty.
Tried the following but having some problems.
set cerr = `echo $f | awk '/^-|=|!.ry|!.xt|!.dat/'` (4 Replies)
Hi All,
I need help as i am not able to create shell script for a scenario.
i have 3000 numbers and want to search all the files which contain anyone of the above pattern.
the files are in folder structure.
Thanks and Regards
Rishi Dhawan (14 Replies)
Hi,
I have multiple files in my log folder. e.g:
a_m1.log
b_1.log
c_1.log
d_1.log
b_2.log
c_2.log
d_2.log
e_m1.log
a_m2.log
e_m2.log
I need to keep latest 10 instances of each file.
I can write multiple find commands but looking if it is possible in one line.
m file are monthly... (4 Replies)
Hello.
For a given folder, I want to select any files find $PATH1 -f \( -name "*" but omit any files like pattern name ! -iname "*.jpg" ! -iname "*.xsession*" ..... \) and also omit any subfolder like pattern name -type d \( -name "/etc/gconf/gconf.*" -o -name "*cache*" -o -name "*Cache*" -o... (2 Replies)
Delete patterns matching
OS version: RHEL 7.3
Shell : Bash
I have a file like below (pattern.txt). I need to delete all lines starting with the following words (words separated by comma below) and ) character.
LOGGING, NOCOMPRESS, TABLESPACE , PCTFREE, INITRANS, MAXTRANS, STORAGE,... (3 Replies)
Discussion started by: John K
3 Replies
LEARN ABOUT DEBIAN
shellexp
SHELLEXP(3) Library Functions Manual SHELLEXP(3)NAME
shellexp - match string against a cruft filter pattern
SYNOPSIS
extern int shellexp(const char *string, const char *pattern);
DESCRIPTION
The shellexp() function is similar to fnmatch(3), but works with cruft patterns instead of standard glob(7) patterns. The function returns
a true value if string matches the cruft pattern pattern, and a false value (0) otherwise. Returns -1 in case of pattern syntax error.
Cruft patterns are similar to glob(7) patterns, but are not fully compatible. The following special characters are supported:
? (a question mark)
matches exacly one character of string other than a slash.
* matches zero or more characters of string other than a slash.
/** or /**/
matches zero or more path components in string. Please note that you can only use ** when directly following a slash, and further-
more, only when either directly preceding a slash or at the very end of pattern. A ** followed by anything other than a slash makes
pattern invalid. A ** following anything else than a slash reduces it to having the same effect as *.
[character-class]
Matches any character between the brackets exactly once. Named character classes are NOT supported. If the first character of the
class is ! or ^, then the meaning is inverted (matches any character NOT listed between the brackets). If you want to specify a
literal closing bracket in the class, then specify it as the first (or second, if you want to negate) character after the opening
bracket. Also, simple ASCII-order ranges are supported using a dash character (see examples section).
Any other character matches itself.
EXAMPLES
/a/b*/*c
matches /a/b/xyz.c, as well as /a/bcd/.c, but not /a/b/c/d.c.
/a/**/*.c
matches all of the following: /a/a.c, /a/b/a.c, /a/b/c/a.c and /a/b/c/d/a.c.
/a/[0-9][^0-9]*
matches /a/1abc, but not /a/12bc.
BUGS
Uses constant-length 1000 byte buffers to hold filenames. Also uses recursive function calls, which are not very efficient. Does not vali-
date the pattern before matching, so any pattern errors (unbalanced brackets or misplaced **) are only reported when and if the matching
algorithm reaches them.
SEE ALSO fnmatch(3), glob(3), cruft(8) and dash-search(1).
AUTHOR
This manual page was written by Marcin Owsiany <porridge@debian.org>, for the Debian GNU/Linux system (but may be used by others).
October 17, 2007 SHELLEXP(3)