Sponsored Content
Full Discussion: Combining Expressions
Top Forums UNIX for Dummies Questions & Answers Combining Expressions Post 302290942 by vgersh99 on Tuesday 24th of February 2009 10:15:54 AM
Old 02-24-2009
Quote:
Originally Posted by davewg
Smilie

Hi, thanks for your response, that's really helpful. This is the 'UNIX for Dummies' forum - "All UNIX and Linux newbies welcome" - hence there perhaps be a slight lack of understanding of everything unix related, and perhaps even sometimes, the occasional grammatical mistake or ommition when posting a thread requesting help. I would assume this is to be expected, and really clever, cool people like you would overlook such minor oversights and simply offer the help and assistance us newbies are requesting with your vastly superior knowledge that inevitably makes you such a big hit with the ladies. Smilie

I wish I was like you.

Smilie
This is perfectly understood and expected.
BTW, there's no need to reveal my personal secrets in public!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Regular Expressions

How can i create a regular expression which can detect a new line charcter followed by a special character say * and replace these both by a string of zero length? Eg: Input File san.txt hello hi ... (6 Replies)
Discussion started by: sandeep_hi
6 Replies

2. Shell Programming and Scripting

regular expressions

Hi, can anyone advise me how to shorten this: if || ; then I tried but it dosent seem to work, whats the correct way. Cheers (4 Replies)
Discussion started by: jack1981
4 Replies

3. UNIX for Dummies Questions & Answers

regular expressions

Hi Gurus, I need help with regular expressions. I want to create a regular expression which will take only alpha-numeric characters for 7 characters long and will throw out an error if longer than that. i tried various combinations but couldn't get it, please help me how to get it guys. ... (2 Replies)
Discussion started by: ragha81
2 Replies

4. Shell Programming and Scripting

regular expressions

Hello, Let say I have a string with content "Free 100%". How can extract only "100" using ksh? I would this machanism to work if instead of "100" there is any kind of combination of numbers(ex. "32", "1238", "1"). I want to get only the digits. I have written something like this: ... (4 Replies)
Discussion started by: whatever
4 Replies

5. UNIX for Advanced & Expert Users

Regular Expressions

Hi, below is a piece of code written by my predecessor at work. I'm kind of a newbie and am trying to figure out all the regular expressions in this piece of code. It is really a tough time for me to figure out all the regular expressions. Please shed some light on the regular expressions... (3 Replies)
Discussion started by: ramky79
3 Replies

6. UNIX for Dummies Questions & Answers

Unix Expressions

Hi to all, this is my first time in the forum...and I know some basic's about UNIX... I want to write an expression to validate a field. field is varchar2, length is 5, can be from '00001' to '99999'. no loops or if condition, just check the value if between these two numbers it is OK if it is... (2 Replies)
Discussion started by: 786habeeb
2 Replies

7. Shell Programming and Scripting

Need help with Regular Expressions

Hi, In ksh, I am trying to compare folder names having -141- in it's name. e.g.: 4567-141-8098 should match this expression '*-141-*' but, -141-2354 should fail when compared with '*-141-*' simlarly, abc should fail when compared with '*-141-*' I tried multiple things but nevertheless,... (5 Replies)
Discussion started by: jidsh
5 Replies

8. Shell Programming and Scripting

Help with regular expressions

I have a file that I'm trying to find all the cases of phone number extensions and deleting them. So input file looks like: abc x93825 def 13234 x52673 hello output looks like: abc def 13234 hello Basically delete lines that have 5 numbers following "x". I tried: x\(4) but it... (7 Replies)
Discussion started by: pxalpine
7 Replies

9. Homework & Coursework Questions

Boolean expressions for If's

1. The problem statement, all variables and given/known data: Im experimenting with if expressions for an assignment. What i want to do is check if an input of read x y z will be checked against x for 1-999 for y for and for z for 1-999. Am i doing this right? or perhaps you could tell me... (0 Replies)
Discussion started by: Ren_kun
0 Replies

10. Shell Programming and Scripting

Regular expressions

I need to pick a part of string lets stay started with specific character and end with specific character to replace using sed command the line is like this:my audio book 71-skhdfon1dufgjhgf8.wav' I want to move the characters beginning with - end before. I have different files with random... (2 Replies)
Discussion started by: XP_2600
2 Replies
MH-ALIAS(5)                                                          [nmh-1.5]                                                         MH-ALIAS(5)

NAME
mh-alias - alias file for nmh message system SYNOPSIS
any nmh command DESCRIPTION
This describes both nmh personal alias files and the global alias file for nmh mail delivery, the file /etc/nmh/MailAliases It does not describe aliases files used by the message transport system. Each line of the alias file has the format: alias : address-group or alias ; address-group or < alias-file or ; comment where: address-group := address-list | < file | = UNIX-group | + UNIX-group | * address-list := address | address-list, address Continuation lines in alias files end with `' followed by the newline character. "Alias-file" and "file" are UNIX file names. UNIX-group is a group name (or number) from /etc/group. An address is a "simple" Inter- net-style address. Througout this file, case is ignored, except for file names. If the line starts with a `<', then the file named after the `<' is read for more alias definitions. The reading is done recursively, so a `<' may occur in the beginning of an alias file with the expected results. If the address-group starts with a `<', then the file named after the `<' is read and its contents are added to the address-list for the alias. If the address-group starts with an `=', then the file /etc/group is consulted for the UNIX-group named after the `='. Each login name occurring as a member of the group is added to the address-list for the alias. In contrast, if the address-group starts with a `+', then the file /etc/group is consulted to determine the group-id of the UNIX-group named after the `+'. Each login name occurring in the /etc/passwd file whose group-id is indicated by this group is added to the address-list for the alias. If the address-group is simply `*', then the file /etc/passwd is consulted and all login names with a userid greater than some magic number (usually 200) are added to the address-list for the alias. In match, a trailing "*" on an alias will match just about anything appropriate. (See example below.) An approximation of the way aliases are resolved at posting time is (it's not really done this way): 1) Build a list of all addresses from the message to be delivered, eliminating duplicate addresses. 2) If this draft originated on the local host, then for those addresses in the message that have no host specified, perform alias resolu- tion. 3) For each line in the alias file, compare "alias" against all of the existing addresses. If a match, remove the matched "alias" from the address list, and add each new address in the address-group to the address list if it is not already on the list. The alias itself is not usually output, rather the address-group that the alias maps to is output instead. If "alias" is terminated with a `;' instead of a `:', then both the "alias" and the address are output in the correct format. (This makes replies possible since nmh aliases and personal aliases are unknown to the mail transport system.) Since the alias file is read line by line, forward references work, but backward references are not recognized, thus, there is no recur- sion. Example Alias File: </etc/nmh/BBoardAliases sgroup: fred, fear, freida b-people: Blind List: bill, betty; fred: frated@UCI UNIX-committee: <unix.aliases staff: =staff wheels: +wheel everyone: * news.*: news The first line says that more aliases should immediately be read from the file /etc/nmh/BBoardAliases. Following this, "fred" is defined as an alias for "frated@UCI", and "sgroup" is defined as an alias for the three names "frated@UCI", "fear", and "freida". The alias "b-people" is a blind list which includes the addresses "bill" and "betty"; the message will be delieved to those addresses, but the message header will show only "Blind List: ;" (not the addresses). Next, the definition of "UNIX-committee" is given by reading the file unix.aliases in the users nmh directory, "staff" is defined as all users who are listed as members of the group "staff" in the /etc/group file, and "wheels" is defined as all users whose group-id in /etc/passwd is equivalent to the "wheel" group. Finally, "everyone" is defined as all users with a user-id in /etc/passwd greater than 200, and all aliases of the form "news.<anything>" are defined to be "news". The key thing to understand about aliasing in nmh is that aliases in nmh alias files are expanded into the headers of messages posted. This aliasing occurs first, at posting time, without the knowledge of the message transport system. In contrast, once the message trans- port system is given a message to deliver to a list of addresses, for each address that appears to be local, a system-wide alias file is consulted. These aliases are NOT expanded into the headers of messages delivered. HELPFUL HINTS
To use aliasing in nmh quickly, do the following: 1) In your .mh_profile, choose a name for your alias file, say "aliases", and add the line: Aliasfile: aliases 2) Create the file "aliases" in your nmh directory. 3) Start adding aliases to your "aliases" file as appropriate. FILES
/etc/nmh/MailAliases global nmh alias file PROFILE COMPONENTS
Aliasfile: For a default alias file SEE ALSO
ali(1), send(1), whom(1), group(5), passwd(5), conflict(8), post(8) CONTEXT
None BUGS
Although the forward-referencing semantics of mh-alias files prevent recursion, the "< alias-file" command may defeat this. Since the num- ber of file descriptors is finite (and very limited), such infinite recursion will terminate with a meaningless diagnostic when all the fds are used up. Forward references do not work correctly inside blind lists. MH.6.8 11 June 2012 MH-ALIAS(5)
All times are GMT -4. The time now is 06:42 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy