Sponsored Content
Full Discussion: Perl Regex problem
Top Forums Shell Programming and Scripting Perl Regex problem Post 302985717 by Corona688 on Monday 14th of November 2016 12:22:37 PM
Old 11-14-2016
Show the input you get and the output you want.

I'm not sure that code is actually doing what you want, either. I'm guessing you want to send 'show int' to the switch, and have Perl filter the rest? Or is the command you enter in the switch LITERALLY show int | i proto.* ... because that's what I think is happening here.

Last edited by Corona688; 11-14-2016 at 01:31 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Perl REGEX

Hi, Can anyone help me to find regular expression for the following in Perl? "The string can only contain lower case letters (a-z) and no more than one of any letter." For example: "table" is accepted, whether "dude" is not. I have coded like this: $str = "table"; if ($str =~ m/\b()\b/) {... (4 Replies)
Discussion started by: evilfreakz
4 Replies

2. Shell Programming and Scripting

Perl regex

I have got numbers like l255677 l376039 l188144 l340482 l440700 l254113 to match the numbers starting with '13' what would be the regex =~/13(.*)/ =======>This is not working .... But for user123,user657 regex =~/user(.*)/ ========>works Thanks for help..!! (7 Replies)
Discussion started by: trina_1
7 Replies

3. Shell Programming and Scripting

Converting perl regex to sed regex

I am having trouble parsing rpm filenames in a shell script.. I found a snippet of perl code that will perform the task but I really don't have time to rewrite the entire script in perl. I cannot for the life of me convert this code into something sed-friendly: if ($rpm =~ /(*)-(*)-(*)\.(.*)/)... (1 Reply)
Discussion started by: suntzu
1 Replies

4. UNIX for Dummies Questions & Answers

Perl Regex Help!!!

Hi, I get the following when I cat a file *.log xxxxx ===== dasdas gwdgsg fdsagfsag agsdfag ===== random data ===== My output should look like : If the random data after the 2nd ==== is null then OK should be printed else the random data should be printed. How do I go about this... (5 Replies)
Discussion started by: manutd
5 Replies

5. Programming

Perl regex

HI, I'm new to perl and need simple regex for reading a file using my perl script. The text file reads as - filename=/pot/uio/current/myremificates.txt certificates=/pot/uio/current/userdir/conf/user/gamma/settings/security/... (3 Replies)
Discussion started by: jhamaks
3 Replies

6. Programming

Perl regex

Hi Guys I have the following regex $OSRELEASE = $1 if ($output =~ /(Mac OS X (Server )?10.\d)/); output is currently Mac OS X 10.7.5 when the introduction of Mac 10.8 output changes to OS X 10.8.2 they have dropped the Mac bit so i changed the regex to be (2 Replies)
Discussion started by: ab52
2 Replies

7. Programming

Perl regex

Hello folks, Looking for a quick help on regex in my perl script. here's the string i want to parse and get the 2nd field out of it. $str = " 2013-08-07 12:29 Beta ACTIVE"; I want to extract 'Beta' out of this string. This string will keep on changing... (2 Replies)
Discussion started by: jhamaks
2 Replies

8. Shell Programming and Scripting

?= in perl regex

Could anyone please make me understand how the ?= works below .. After executing this I am getting the same output. $string="I love chocolate."; $string =~ s/chocolate(?= ice)/vanilla/; print "$string\n"; (2 Replies)
Discussion started by: scriptscript
2 Replies

9. UNIX for Advanced & Expert Users

Perl regex problem on strings with several occurences of one char

Hi all, i have the following line in a record file : retenu=non demande=non script=#vtbackup /path=/save/backup/demande position=140+70 and i want to use Perl regex to have the following output key : "retenu" value : "non" key : "demande" value "non" key : "script" value :... (2 Replies)
Discussion started by: Fundix
2 Replies

10. Shell Programming and Scripting

Perl, RegEx - Help me to understand the regex!

I am not a big expert in regex and have just little understanding of that language. Could you help me to understand the regular Perl expression: ^(?!if\b|else\b|while\b|)(?:+?\s+){1,6}(+\s*)\(*\) *?(?:^*;?+){0,10}\{ ------ This is regex to select functions from a C/C++ source and defined in... (2 Replies)
Discussion started by: alex_5161
2 Replies
SHOW(1) 							     [nmh-1.5]								   SHOW(1)

NAME
show - show (display) messages SYNOPSIS
show [+folder] [msgs] [-draft] [-showproc program] [-showmimeproc program] [-header | -noheader] [-checkmime | -nocheckmime] [switches for showproc or showmimeproc] [-version] [-help] DESCRIPTION
Show lists each of the specified messages to the standard output (typically, the terminal). By default, text (non-MIME) messages are filtered and displayed by the nmh command mhl. This command will display text messages in a nice, uniform format. It also allows you to configure the format of the displayed messages and which headers fields are shown. See the mhl(1) manual page for the details about this command. This default can be changed by defining the showproc profile component. Any switches not recognized by show are passed along to that program. To override the default and the showproc profile component, use the -showproc program switch. For example, -showproc more will cause the more program to list the messages with no reformatting. Normally, this program is specified as the showproc in the user's .mh_profile, rather than using a command line switch. By default, non-text messages (MIME messages with multi-media contents) are processed and displayed by the nmh command mhshow. See the mhshow(1) manual page for details about this command. This default can changed by defining the showmimeproc profile component. Any switches not recognized by show are passed along to that program. To override this default and the showmimeproc profile component, use the -showmimeproc program switch. Note that in some cases, show may invoke the showmimeproc even for textual contents. This will happen for text messages that specify a transfer encoding (such as MIME quoted-printable or base64) or specify a character set that show doesn't believe can be displayed natively. The environment variable $MM_CHARSET should be set to the terminal's native character set to avoid gratuitous invocations of the showmime- proc. See the mh-profile(5) man page for details about this environment variable. The option -checkmime (set by default) instructs show to test if any of the messages to be displayed are non-text (MIME) messages. If any are non-text, they are displayed by the program showmimeproc, else they are displayed by the program showproc. The option -nocheckmime disables this test and instructs show to use showproc, regardless of whether any of the messages are non-text (MIME) messages. The -noshowproc switch will disable any formatting or paging of messages. It is equivalent to -nocheckmime -showproc cat. It is still accepted, but should be considered (somewhat) obsolete. If the environment variable $NOMHNPROC is set, the test for non-text (MIME) messages will be disabled. This method is obsolete. Use the -nocheckmime switch instead. The -header switch tells show to display a one-line description of the message being shown. This description includes the folder and the message number. If no `msgs' are specified, the current message is used. Although it depends on the specific showproc or showmimeproc, in the default set- up when more than one message is specified, you will be prompted for a <RETURN> prior to listing each message. Each message will be listed a page at a time, and when the end of page is reached, the program will wait for a <SPACE> or <RETURN>. If a <RETURN> is entered, it will print the next line, whereas <SPACE> will print the next screenful. If the standard output is not a terminal, no queries are made, and each file is listed with a one-line header and two lines of separation. "show -draft" will list the file <mh-dir>/draft if it exists. If the profile entry "Unseen-Sequence" is present and non-empty, then show will remove each of the messages shown from each sequence named by the profile entry. 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 Unseen-Sequence: To name sequences denoting unseen messages showproc: Program to show text (non-MIME) messages showmimeproc: Program to show non-text (MIME) messages SEE ALSO
mhl(1), mhshow(1), more(1), next(1), prev(1), scan(1) DEFAULTS
`+folder' defaults to the current folder `msgs' defaults to cur `-checkmime' `-header' CONTEXT
If a folder is given, it will become the current folder. The last message selected will become the current message. BUGS
The -header switch doesn't work when `msgs' expands to more than one message. If the showproc is mhl, then this problem can be circum- vented by referencing the "messagename" field in the mhl format file. Show updates the user's context before showing the message. Hence show will mark messages as seen prior to the user actually seeing them. This is generally not a problem, unless the user relies on the "unseen" messages mechanism, and interrupts show while it is showing "unseen" messages. If your showproc is mhl (the default), then show uses a built-in mhl: it does not actually run the mhl program. Hence, if you define your own showproc , don't call it mhl since show won't run it. If your showproc is the pager more, then avoid running show in the background with only its standard output piped to another process, as in show | imprint & Due to a bug in more, show will go into a "tty input" state. To avoid this problem, re-direct show's diagnostic output as well. For users of csh: show |& imprint & For users of sh: show 2>&1 | imprint & MH.6.8 11 June 2012 SHOW(1)
All times are GMT -4. The time now is 06:37 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy