08-13-2012
Perfect match? What are you matching? Do you mean FileA matches FileB if both files have the same contents?
Do you mean match lines in FileA and FileB? If so what constitutes a matching line? Do they match if the first field matches, first two fields match, first three fields, all fields match but spacing between fields can be different, the entire lines are identical, or something else?
Are the input files supposed to be sorted? (In your example they aren't.)
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I followed the egrep example given in the thread "parse text or complex grep ?". It is exactly what I need...except... how do I insert a blank line after the second line? My exact command is:
egrep 'patt1|patt2' filename
the result is:
patt1
patt2
patt1
patt2
and so on. I would... (2 Replies)
Discussion started by: antalexi
2 Replies
2. Programming
hi,
I am looking for some info on how can we implement state machines.
Conceptually it appears to be good but while implementing it causes lot of confusion..
I have some doubts regarding this concept.
(my explanation may look wired, as I am also not clear on this front)
The commonly... (2 Replies)
Discussion started by: parasa
2 Replies
3. UNIX for Dummies Questions & Answers
Hi I've been searching google and have not found what egrep -c means. Does anyone know where I can get a cheat sheet or what that -c means?
thanks,
Linda (2 Replies)
Discussion started by: leelm
2 Replies
4. Shell Programming and Scripting
Hi !!! Dear People,
Please help me with the following problem.
consider this output:
Top 5 Timed Events
~~~~~~~~~~~~ Total
Event Waits Time (s) Ela Time
---------------------------- ------------ ----------- -----
CPU time ... (3 Replies)
Discussion started by: user__user3110
3 Replies
5. Shell Programming and Scripting
Is it possible to use the escape sequence:
\r
to match a line feed in grep/egrep?
I want to use a regexp that crosses over two lines, and it does not seem to be possible. (1 Reply)
Discussion started by: Enobarbus37
1 Replies
6. Shell Programming and Scripting
I have the following script that searches in several files and shows the search results and the matches filename on the screen.
find . -exec egrep -wH "word1|word2" {} \;
the output from the search display as:
file1
word1
word2
I need to show each file search output result on new... (5 Replies)
Discussion started by: konddor
5 Replies
7. Shell Programming and Scripting
Can some one help me to print 4th line before the match using egrep or grep command options.
i have a very large file and i need to search the entire file, look for the match (key word) and print 4th line before the matched key word. (9 Replies)
Discussion started by: ramana117
9 Replies
8. UNIX for Dummies Questions & Answers
hello everyone,
can anyone tell me what drivers the Mach kernel works with. I'm thinking about experimenting with the Mach kernel, and yes I know there are other kernels that are easier to work with but I just want to use the Mach kernel. So with that being said, can the Mach kernel work with... (11 Replies)
Discussion started by: neur0n
11 Replies
9. UNIX for Dummies Questions & Answers
hey everyone,
I'm reading a tutorial on the Mach kernel principles, however, the port and port rights part are kind of confusing to me. I don't know if the book has typos or something but it seems a bit contradictory. It says that "ports, themselves, are not named. It is the port rights that are"... (10 Replies)
Discussion started by: neur0n
10 Replies
10. UNIX for Dummies Questions & Answers
HI Guys,
I want egrep from ./txt file which begging from Hello.
File A.txt
Hello A
Abc
Abc
Xyz
Hello B
Hello C
..
...
Output File B
Hello A
Hello B (2 Replies)
Discussion started by: asavaliya
2 Replies
ANNO(1) [nmh-1.5] ANNO(1)
NAME
anno - annotate messages
SYNOPSIS
anno [+folder] [msgs] [-component field] [-inplace | -noinplace] [-date | -nodate] [-draft] [-append] [-list] [-delete] [-number [num|all]]
[-preserve | -nopreserve] [-version] [-help] [-text body]
DESCRIPTION
Anno manipulates header fields or annotations in messages. Header fields consist of a field name and an optional field body as defined by
RFC-2822. The -component option specifies the field name, and the -text option specifies the field body.
The messages are either the msgs in the named folder, or the draft if invoked with the -draft option.
Usually, annotation is performed by the commands dist, forw, and repl, if they are given the -anno switch. This allows you to keep track
of your distribution of, forwarding of, and replies to a message.
By using anno, you can perform arbitrary annotations of your own. Each message selected will be annotated with the lines
field: date
field: body
The -nodate switch inhibits the date annotation, leaving only the body annotation.
By default, anno prepends the annotations to the message. Annotations are instead appended if the -append option is specified.
If a -component field is not specified when anno is invoked, anno will prompt the user for the name of field for the annotation.
The field specified must be a valid 2822-style message field name, which means that it may only consist of alphanumerics and dashes, The
body specified is arbitrary text.
Normally anno does the annotation inplace in order to preserve any links to the message. You may change this by using the -noinplace
switch.
The -list option produces a listing of the field bodies for header fields with names matching the specified component, one per line. The
listing is numbered, starting at 1, if the -number option is also used. A tab character separates the number and the field body. The
field body is treated as if it is a file name, and only the final path name component is listed. The complete field body is listed if the
-text option is used, the contents of the text are ignored.
The -delete option removes header fields from messages. The first header field whose name matches the component is deleted if no other
options are specified. If the -text option is used in conjunction with the -delete option, the first header field whose name matches the
component and whose body matches the text is deleted. The text is treated as if it was a file name; if it begins with a slash, the entire
field body must match the text, otherwise just the last path name component of the field body must match. If the -number option is used in
conjuction with the -delete option, header field num whose name matches the component is deleted. The number matches that which is pro-
duced by the -list option. The special value all can be used for the number, and causes all components that match the name to be deleted.
By default, anno changes the last-accessed and last-modified times on annotate messages to the time at which the annotation occurs. Anno
preserves the original times if the -preserve option is used. A matching -nopreserve option exists that allows time preservation to be
turned off if enabled in the profile.
FILES
$HOME/.mh_profile The user profile
PROFILE COMPONENTS
Path: To determine the user's nmh directory
Current-Folder: To find the default current folder
SEE ALSO
dist(1), forw(1), repl(1)
DEFAULTS
`+folder' defaults to the current folder
`msgs' defaults to cur
`-inplace'
`-date'
CONTEXT
If a folder is given, it will become the current folder. The first message annotated will become the current message.
MH.6.8 11 June 2012 ANNO(1)