Sponsored Content
Full Discussion: grep concatenation??
Top Forums UNIX for Dummies Questions & Answers grep concatenation?? Post 302580440 by Iifa on Thursday 8th of December 2011 01:26:59 PM
Old 12-08-2011
the grep "Sequence" -2 results.out ... prints only the second line from Sequence..

the egrep didn't work for me, as in my results file the actual sequence is based two lines after "Sequence".

I was thinking of making a script or something, but the idea died half way through..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Concatenation

What is syntax for String concatenation? I have $1 as directory. $var is some variable value '/' String value. How do I have to concatenate if I have to run utility - util $1 followed by '/' followed by $var There is no space between these three. (2 Replies)
Discussion started by: videsh77
2 Replies

2. UNIX for Dummies Questions & Answers

string concatenation

my input file contains thousands of lines like below 234A dept of education 9788 dept of commerce 8677 dept of engineering How do i add a delimeter ':' after FIRST 4 CHARACTERS in a line 234A:dept of education 9788:dept of commerce 8677:dept of engineering (7 Replies)
Discussion started by: systemsb
7 Replies

3. UNIX for Dummies Questions & Answers

File Concatenation

Hi, I want to write a generic shell script, which can concatenate n number of files passed as parameter ;to an output file which is again a parameter Example catfl.sh outfl.txt a.txt b.txt c.txt (3 files to be concatenated into a file outfl.txt) catfl.sh outfl.txt a.txt b.txt(2 files to be... (3 Replies)
Discussion started by: samit_9999
3 Replies

4. Shell Programming and Scripting

Concatenation

How can I do this: date = 4 -----------> 04 Month= 3-----------> 03 I wish to make a varibale named Var1 which will hold the value of current date and month value as: 2 digits for date. 2 digits for month. So finally var1 should hold value as 0403 --- MMDD (11 Replies)
Discussion started by: Asteroid
11 Replies

5. UNIX for Dummies Questions & Answers

Recursive Concatenation

Hi, I have a problem with concatenation text files. I have a directory, say 'foo' Inside this folder, I have many sub folders, say 'oof1, oof2 .... oof20' Each oof directory has a number of text files inside it. I need to concatenate all the text files in oof directories within foo...... (1 Reply)
Discussion started by: Kerensa@unsw.ed
1 Replies

6. Shell Programming and Scripting

String concatenation

Hi, I have two files. cat file.txt a b c d cat file1.txt j k l m I need the output as a:j (12 Replies)
Discussion started by: nareshkumar522
12 Replies

7. Shell Programming and Scripting

Concatenation of two patterns

Read the lines from the file and concatenate the lines into single line then search the string "INPUT=" from the another file and if "INPUT" is present in that file assign the concatenate patterns into "INPUT=" pattern. example: file1.txt <some lines> INPUT = <some lines> file2.txt... (3 Replies)
Discussion started by: krsureshmca
3 Replies

8. Shell Programming and Scripting

Line concatenation help

please help me on this.... cat /xx.txt 2:1 2 2:2 24 8:0 0 9:0 0 Expected result would be 2:1 2 2:2 24 8:0 0 9:0 0 (4 Replies)
Discussion started by: Aditya.Gurgaon
4 Replies

9. Shell Programming and Scripting

Help with String concatenation

I have a script which is migrated from AIX to Linux & now while running it is no able to concatenate string values The string concatenation step under while loop is not displaying desired result Please find below the piece of code: while read EXT_FILE ; do EXT_FILE=$EXT_FILE.ext.sent echo... (7 Replies)
Discussion started by: PreetArul
7 Replies

10. UNIX for Beginners Questions & Answers

Concatenation script

Hi, I have the following reports that get generated every 1 hour and this is my requirement: 1. 5 reports get generated every hour with the names "Report.Dddmmyy.Thhmiss.CTLR" "Report.Dddmmyy.Thhmiss.ACCD" "Report.Dddmmyy.Thhmiss.BCCD" "Report.Dddmmyy.Thhmiss.CCCD"... (1 Reply)
Discussion started by: Jesshelle David
1 Replies
MH-SEQUENCE(5)							     [nmh-1.5]							    MH-SEQUENCE(5)

NAME
mh-sequence - sequence specification for nmh message system SYNOPSIS
most nmh commands DESCRIPTION
A sequence (or sequence set) is a symbolic name representing a message or collection of messages. nmh has several internally defined sequences, as well as allowing users to define their own sequences. Message Specification and Pre-Defined Message Sequences Most nmh commands accept a `msg' or `msgs' specification, where `msg' indicates one message and `msgs' indicates one or more messages. To designate a message, you may use either its number (e.g., 1, 10, 234) or one of these "reserved" message names: Name Description first the first message in the folder last the last message in the folder cur the most recently accessed message prev the message numerically preceding "cur" next the message numerically following "cur" In commands that take a `msg' argument, the default is "cur". As a shorthand, "." is equivalent to "cur". For example: In a folder containing five messages numbered 5, 10, 94, 177 and 325, "first" is 5 and "last" is 325. If "cur" is 94, then "prev" is 10 and "next" is 177. The word `msgs' indicates that one or more messages may be specified. Such a specification consists of one message designation or of sev- eral message designations separated by spaces. A message designation consists either of a message name as defined above, or a message range. A message range is specified as "name1-name2" or "name:n", where `name', `name1' and `name2' are message names, and `n' is an integer. The specification "name1-name2" designates all currently existing messages from `name1' to `name2' inclusive. The "reserved" message name "all" is a shorthand for the message range "first-last". The specification "name:n" designates up to `n' messages. These messages start with `name' if `name' is a message number or one of the reserved names "first" "cur", or "next", The messages end with `name' if `name' is "prev" or "last". The interpretation of `n' may be overridden by preceding `n' with a plus or minus sign; `+n' always means up to `n' messages starting with `name', and `-n' always means up to `n' messages ending with `name'. In commands which accept a `msgs' argument, the default is either "cur" or "all", depending on which makes more sense for each command (see the individual man pages for details). Repeated specifications of the same message have the same effect as a single specification of the message. There is also a special "reserved" message name "new" which is used by the mhpath command. User-Defined Message Sequences In addition to the "reserved" (pre-defined) message names given above, nmh supports user-defined sequence names. User-defined sequences allow the nmh user a tremendous amount of power in dealing with groups of messages in the same folder by allowing the user to bind a group of messages to a meaningful symbolic name. The name used to denote a message sequence must consist of an alphabetic character followed by zero or more alphanumeric characters, and can not be one of the "reserved" message names above. After defining a sequence, it can be used wherever an nmh command expects a `msg' or `msgs' argument. Some forms of message ranges are allowed with user-defined sequences. The specification "name:n" may be used, and it designates up to the first `n' messages (or last `n' messages for `-n') which are elements of the user-defined sequence `name'. The specifications "name:next" and "name:prev" may also be used, and they designate the next or previous message (relative to the current message) which is an element of the user-defined sequence `name'. The specifications "name:first" and "name:last" are equivalent to "name:1" and "name:-1", respectively. The specification "name:cur" is not allowed (use just "cur" instead). The syntax of these message range specifications is subject to change in the future. User-defined sequence names are specific to each folder. They are defined using the pick and mark commands. Public and Private User-Defined Sequences There are two varieties of user-defined sequences: public and private. Public sequences of a folder are accessible to any nmh user that can read that folder. They are kept in each folder in the file determined by the "mh-sequences" profile entry (default is .mh_sequences). Private sequences are accessible only to the nmh user that defined those sequences and are kept in the user's nmh context file. In general, the commands that create sequences (such as pick and mark) will create public sequences if the folder for which the sequences are being defined is writable by the nmh user. For most commands, this can be overridden by using the switches -public and -private. But if the folder is read-only, or if the "mh-sequences" profile entry is defined but empty, then private sequences will be created instead. Sequence Negation Nmh provides the ability to select all messages not elements of a user-defined sequence. To do this, the user should define the entry "Sequence-Negation" in the nmh profile file; its value may be any string. This string is then used to preface an existing user-defined sequence name. This specification then refers to those messages not elements of the specified sequence name. For example, if the profile entry is: Sequence-Negation: not then anytime an nmh command is given "notfoo" as a `msg' or `msgs' argument, it would substitute all messages that are not elements of the sequence "foo". Obviously, the user should beware of defining sequences with names that begin with the value of the "Sequence-Negation" profile entry. The Previous Sequence Nmh provides the ability to remember the `msgs' or `msg' argument last given to an nmh command. The entry "Previous-Sequence" should be defined in the nmh profile; its value should be a sequence name or multiple sequence names separated by spaces. If this entry is defined, when when an nmh command finishes, it will define the sequence(s) named in the value of this entry to be those messages that were specified to the command. Hence, a profile entry of Previous-Sequence: pseq directs any nmh command that accepts a `msg' or `msgs' argument to define the sequence "pseq" as those messages when it finishes. Note: there can be a performance penalty in using the "Previous-Sequence" facility. If it is used, all nmh programs have to write the sequence information to the .mh_sequences file for the folder each time they run. If the "Previous-Sequence" profile entry is not included, only pick and mark will write to the .mh_sequences file. The Unseen Sequence Finally, many users like to indicate which messages have not been previously seen by them. The commands inc, rcvstore, show, mhshow, and flist honor the profile entry "Unseen-Sequence" to support this activity. This entry in the .mh_profile should be defined as one or more sequence names separated by spaces. If there is a value for "Unseen-Sequence" in the profile, then whenever new messages are placed in a folder (using inc or rcvstore), the new messages will also be added to all the sequences named in this profile entry. For example, a pro- file entry of Unseen-Sequence: unseen directs inc to add new messages to the sequence "unseen". Unlike the behavior of the "Previous-Sequence" entry in the profile, however, the sequence(s) will not be zeroed by inc. Similarly, whenever show, mhshow, next, or prev displays a message, that message will be removed from any sequences named by the "Unseen-Sequence" entry in the profile. FILES
$HOME/.mh_profile The user profile <mh-dir>/context The user context <folder>/.mh_sequences File for public sequences PROFILE COMPONENTS
mh-sequences: Name of file to store public sequences Sequence-Negation: To designate messages not in a sequence Previous-Sequence: The last message specification given Unseen-Sequence: Those messages not yet seen by the user SEE ALSO
flist(1), mark(1), pick(1), mh-profile(5) DEFAULTS
None MH.6.8 11 June 2012 MH-SEQUENCE(5)
All times are GMT -4. The time now is 08:40 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy