Sponsored Content
Top Forums Shell Programming and Scripting adding characters end of line where line begins with.. Post 302477787 by cabrao on Monday 6th of December 2010 11:00:24 AM
Old 12-06-2010
@satnamx:

Previous command was updated, please have a look at it Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding new line at the end of file

Hi I have few files. For some files the cursor is at the end of last line. For other files, cursor is at the new line at the end. I want to bring the cursor down to next line for the files that are having cursor at the end of last line In otherwords, I want to introduce a blank line at the... (5 Replies)
Discussion started by: somesh_p
5 Replies

2. Shell Programming and Scripting

adding semicolumn at end of line

Hi , I need to add semicolumn at the end of each line in a file. can any one help me in this? Thanks in advance (2 Replies)
Discussion started by: scorpio
2 Replies

3. Shell Programming and Scripting

Get the 1st 99 characters and add new line feed at the end of the line

I have a file with varying record length in it. I need to reformat this file so that each line will have a length of 100 characters (99 characters + the line feed). AU * A01 EXPENSE 6990370000 CWF SUBC TRAVEL & MISC MY * A02 RESALE 6990788000 Y... (3 Replies)
Discussion started by: udelalv
3 Replies

4. Shell Programming and Scripting

Append text to line if begins with pattern1 AND does not end with pattern2

Hello, I'm looking for sed solution to change ... <li>keyword</li> <li>keyword <li>keyword</li> <li>keyword <li>keyword</li> ... to ... <li>keyword</li> <li>keyword</li> <li>keyword</li> <li>keyword</li> <li>keyword</li> ... I.e., if lines beginning with <li> do not end with... (3 Replies)
Discussion started by: pioavi
3 Replies

5. UNIX for Dummies Questions & Answers

Adding comma at the end of every line

Hi all, I have this sample file (actual file is larger) and i need to add comma at the end of every line. 1234 4335 232345 1212 3535 Output 1234, 4335, 232345, 1212, 3535, TIA - jak (2 Replies)
Discussion started by: jakSun8
2 Replies

6. UNIX for Dummies Questions & Answers

How to specify beginning-of-line/end-of-line characters inside a regex range

How can I specify special meaning characters like ^ or $ inside a regex range. e.g Suppose I want to search for a string that either starts with '|' character or begins with start-of-line character. I tried the following but it does not work: sed 's/\(\)/<do something here>/g' file1 ... (3 Replies)
Discussion started by: jawsnnn
3 Replies

7. Shell Programming and Scripting

Script adding ^M to end of line

I trying to make a simple script to get info from remote servers my problem is the output of this line- SERVER_NAME=`ssh -t $USER@$REMOTESERVER 'hostname'`the output is linux1^M I would like to remove the ^M where is my error? Many Thanks -Steve (1 Reply)
Discussion started by: shoodlum
1 Replies

8. Shell Programming and Scripting

Adding tab/new line at the end of each line of a file

Hello Everyone, I need a help from experts of this community regarding one of the issue that I am facing with shell scripting. My requirement is to append char's at the end of each line of a file. The char that will be appended is variable and will be passed through command line. The... (20 Replies)
Discussion started by: Sourav Das
20 Replies

9. Shell Programming and Scripting

Adding semicolon at the end of each line

Hi, I have a script which I need to change. I want to add a semicolon at the end of each line where the line starts with "grant" for e.g. create table(.... ); grant select on TABL1 to USER1 grant select on TABL1 to USER2should become create table(.... ); grant select on TABL1 to... (3 Replies)
Discussion started by: pparthiv
3 Replies

10. Shell Programming and Scripting

Adding comma to end of each line if more than 1 line

I have a file with dates as '2013-01-01' '2013-01-02' I want the output to be '2013-01-01','2013-01-02' if there is only 1 entry then there should not be any comma. (6 Replies)
Discussion started by: ATWC
6 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 03:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy