10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
I have multiple strings in a file which have special character $, when i search strings by ignoring $ with \ using single quotes it returns empty results.
My search strings are set char_1($lock) and set new_char_clear_3($unlock)
I tried searching with
but it returns empty results.However... (3 Replies)
Discussion started by: g_eashwar
3 Replies
2. Shell Programming and Scripting
I have 4000 files like
$cat clus_grp_seq10_g.phy
18 1002
anig_OJJ65951_1 ATGGTTTCGCAGCGTGATAGAGAATTGTTTAGGGATGATATTCGCTCGCGAGGAACGAAGCTCAATGCTGCCGAGCGCGAGAGTCTGCTAAGGCCATATCTGCCAGATCCGTCTGACCTTCCACGCAGGCCACTTCAGCGGCGCAAGAAGGTTCCTCG
aver_OOF92921_1 ... (1 Reply)
Discussion started by: sammy777888
1 Replies
3. Shell Programming and Scripting
Hi,
I want to grep multiple patterns from multiple files and save to multiple outputs. As of now its outputting all to the same file when I use this command.
Input : 108 files to check for 390 patterns to check for. output I need to 108 files with the searched patterns.
Xargs -I {} grep... (3 Replies)
Discussion started by: Diya123
3 Replies
4. Shell Programming and Scripting
Hi,
I want to grep a file if any one (GH, IJ, KL) is not null. If it is null i dont want to pull anything.
cat file | awk '{print ($1)}'
Parameters are : AB=123;CD=456;EF=6789;
cat file | awk '{print ($2)}'
GH=456;IJ=789;KL=1011
eg:
Contents in file:
Parameters are :... (10 Replies)
Discussion started by: Neethu
10 Replies
5. Shell Programming and Scripting
Hello.
From command line, the command zypper info nxclient
return a bloc of data :
linux local # zypper info nxclient
Loading repository data...
Reading installed packages...
Information for package nxclient:
Repository: zypper_local
Name: nxclient
Version: 3.5.0-7
Arch: x86_64... (7 Replies)
Discussion started by: jcdole
7 Replies
6. Shell Programming and Scripting
Hello All,
I'm a newbie/rookie in Shell scipting. I've done oracle export of a table using Export utility. When I do export, it generates 2 files.
1> .dmp file
2> .dmp.log file.
In .dmp.log file I have to search for a sentence which goes like '0 records have been inserted' and then... (2 Replies)
Discussion started by: samfisher
2 Replies
7. Shell Programming and Scripting
Hi..
How to search for multiple words in a single line using grep?.
Eg: Jack and Jill went up the hill
Jack and Jill were best friends
Humpty and Dumpty were good friends too
----------
I want to extract the 2nd statement(assuming there are several statements with... (11 Replies)
Discussion started by: anduzzi
11 Replies
8. UNIX for Dummies Questions & Answers
Hi frnds
i want to desplay file names that should be word1 and word2
ex :
i have 10 *.log files
5 files having word1 and word2
5 files having only word1,
i have used below command
egrep -l 'word1|word2' *.log
its giving all 10 files, but i want to display only 5... (20 Replies)
Discussion started by: pb18798
20 Replies
9. UNIX for Dummies Questions & Answers
I have been trying to find files containing the words AAA, BBB and CCC.
I tried:
grep AAA `grep BBB files*` grep CCC files*
but is does not work
I tried several ways
this is an easy one but I am a dummy, Does anyone can help me?
Thanks
:( (12 Replies)
Discussion started by: murbina
12 Replies
10. Shell Programming and Scripting
hi,
I have few text templates
as a simple ex:
template 1
city Name:
zip code:
state Name:
template2:
employee Name:
Phone number:
I wish to grep on given text file and make sure the text file matches one of these templates. Please give your ideas. (6 Replies)
Discussion started by: rider29
6 Replies
GLARK(1) glark 1.8.0 GLARK(1)
NAME
glark - Search text files for complex regular expressions
SYNOPSIS
glark [options] expression file ...
DESCRIPTION
Similar to "grep", "glark" offers: Perl-compatible regular expressions, color highlighting of matches, context around matches, complex
expressions ("and" and "or"), grep output emulation, and automatic exclusion of non-text files. Its regular expressions should be familiar
to persons experienced in Perl, Python, or Ruby. File may also be a list of files in the form of a path.
OPTIONS
Input
-0[nnn]
Use
nn (octal) as the input record separator. If nnn is omitted, use '
' as the record separator, which treats paragraphs as
lines.
-d ACTION, --directories=ACTION
Directories are processed according to the given ACTION, which by default is "read". If ACTION is "recurse", each file in the
directory is read and each subdirectory is recursed into (equivalent to the "-r" option). If ACTION is "skip", directories are not
read, and no message is produced.
--binary-files=TYPE
Specify how to handle binary files, thus overriding the default behavior, which is to denote the binary files that match the
expression, without displaying the match. TYPE may be one of: "binary", the default; "without-match", which results in binary files
being skipped; and "text", which results in the binary file being treated as text, the display of which may have bad side effects
with the terminal. Note that the default behavior has changed; this previously was to skip binary files. The same effect may be
achieved by setting binary-files to "without-match" in the ~/.glarkrc file.
--[with-]basename EXPR, --[with-]name EXPR
Search only files whose names match the given regular expression. As in find(1), this works on the basename of the file. This
expression can be negated and modified with "!" and "i", such as '!/io.[hc]$/i'.
--[with-]fullname EXPR, --[with-]path EXPR
Search only files whose names, including path, match the given regular expression. As in find(1), this works on the path of the
file. This expression can be negated and modified with "!" and "i", such as '!/Dialog.*.java$/i'.
--without-basename EXPR, --without-name EXPR
Do not search files with base names matching the given regular expression.
--without-fullname EXPR, --without-path EXPR
Do not search files with full names matching the given regular expression.
-M, --exclude-matching
Do not search files whose names match the given expression. This can be useful for finding external references to a file, or to a
class (assuming that class names match file names).
-r, --recurse
Recurse through directories. Equivalent to --directories=read.
--split-as-path(=VALUE), --no-split-as-path
Sets whether, if a command line argument includes the path separator (such as ":"), the argument should be split by the path sepa-
rator. This functionality is useful for using environment variables as input, such as $PATH and $CLASSPATH, which are automatically
split and processed as a list of files and directories. The default value of this option is "true". "--no-split-as-path" is equiv-
alent to "--split-as-path=false".
--size-limit=SIZE
If provided, files no larger than SIZE bytes will be searched. This is useful when running the "--recurse" option on directories
that may contain large files.
Matching
-a NUM expr1 expr2
--and NUM expr1 expr2
--and=NUM expr1 expr2
( expr1 --and=NUM expr2 )
Match both of the two expressions, within NUM lines of each other. See the EXPRESSIONS section for more information.
-b NUM[%], --before NUM[%]
Restrict the search to before the given location, which represents either the number of the last line within the valid range, or
the percentage of lines to be searched.
--after NUM[%]
Restrict the search to after the given section, which represents either the number of the first line within the valid range, or the
percentage of lines to be skipped.
-f FILE, --file=FILE
Use the lines in the given file as expressions. Each line consists of a regular expression.
-i, --ignore-case
Match regular expressions without regard to case. The default is case sensitive.
-m NUM, --match-limit NUM
Find only the first NUM matches in each file.
-o expr1 expr2
--or expr1 expr2
( expr1 --or expr2 )
Match either of the two expressions. See the EXPRESSIONS section for more information.
-R, --range NUM[%],NUM[%]
Restrict the search to the given range of lines, as either line numbers or a percentage of the length of the file.
-v, --invert-match
Show lines that do not match the expression.
-w, --word, --word-regexp
Put word boundaries around each pattern, thus matching only where the full word(s) occur in the text. Thus, "glark -w Foo" is the
same as "glark '/Foo/'".
-x, --line-regexp
Select only where the entire line matches the pattern(s).
--xor expr1 expr2
( expr1 --xor expr2 )
Match either of the two expressions, but not both. See the EXPRESSIONS section for more information.
Output
-A NUM, --after-context=NUM
Print NUM lines after a matched expression.
-B NUM, --before-context=NUM
Print NUM lines before a matched expression.
-C [NUM], -NUM, --context[=NUM]
Output NUM lines of context around a matched expression. The default is no context. If no NUM is given for this option, the number
of lines of context is 2.
-c, --count
Instead of normal output, display only the number of matches in each file.
-F, --file-color COLOR
Specify the highlight color for file names. See the HIGHLIGHTING section for the values that can be used.
--no-filter
Display the entire file(s), presumably with matches highlighted.
-g, --grep
Produce output like the grep default: file names, no line numbers, and a single line of the match, which will be the first line for
matches that span multiple lines. If the EMACS environment variable is set, this value is set to true. Thus, running glark under
Emacs results in the output format expected by Emacs.
-h, --no-filename
Do not display the names of the files that matched.
-H, --with-filename
Display the names of the files that matched. This is the default behavior.
-l, --files-with-matches
Print only the names of the file that matched the expression.
-L, --files-without-match
Print only the names of the file that did not match the expression.
--label=NAME
Use NAME as output file name. This is useful when reading from standard input.
-n, --line-number
Display the line numbers. This is the default behavior.
-N, --no-line-number
Do not display the line numbers.
--line-number-color
Specify the highlight color for line numbers. This defaults to none (no highlighting). See the HIGHLIGHTING section for more infor-
mation.
-T, --text-color COLOR
Specify the highlight color for text. See the HIGHLIGHTING section for more information.
--text-color-NUM COLOR
Specify the highlight color for the regular expression capture NUM. Colors are used by regular expressions in the order they are
created (that is, with the "--and" and "--or" option), or with captures within a regular expression (such as '/(this)|(that)/'). is
See the HIGHLIGHTING section for more information.
-u, --highlight=[FORMAT]
Enable highlighting. This is the default behavior. Format is "single" (one color) or "multi" (different color per regular expres-
sion). See the HIGHLIGHTING section for more information.
-U, --no-highlight
Disable highlighting.
-y, --extract-matches
Display only the region that matched, not the entire line. If the expression contains "backreferences" (i.e., expressions bounded
by "( ... )"), then only the portion captured will be displayed, not the entire line. This option is useful with "-g", which elimi-
nates the default highlighting and display of file names.
-Z, --null
When in -l mode, write file names followed by the ASCII NUL character ('