Sponsored Content
Top Forums Shell Programming and Scripting Going mad on an egrep command (Reg Expressions) Post 303019468 by Donzo on Friday 29th of June 2018 02:46:17 PM
Old 06-29-2018
Unfortunately I cannot use that as there is a big load of expressions follwing that I excluded here for purpose of better understanding.


I realized it now after over 3 hours with:
Code:
((.+\ )|(\ )|^)Lastname


and it seems to finally work.


But thanks a lot for your effort !

Last edited by MadeInGermany; 06-29-2018 at 06:37 PM.. Reason: added code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

SCO vs Linux Reg Expressions Problem

Hi there, I'm investigating migrating a system currently running Scos osr5 to Linux (eg RH 7.2) but there are a lot of in house scripts, some of which are probably using "Sco specific" constructs etc. One I have come across is as follows, if ????? ] then ....etc.etc fi The regular... (2 Replies)
Discussion started by: pcs7088
2 Replies

2. UNIX for Dummies Questions & Answers

reg script command....

hi frnds, i need all ur help guys.. I am facing problem when i give script < file name> command whenever i give this command,i get an error message indicating "Openpty failed. Terminated" :confused: can u help me out... with regds, Deep (7 Replies)
Discussion started by: deep
7 Replies

3. UNIX for Dummies Questions & Answers

Reg getdents command in linux

Hi frnds, i need ur help reg getdents command which is used to read the directory entries. I need to know the exact usage of the command and any sample code reg the usage of getdents command ------------- deep :confused: (1 Reply)
Discussion started by: deep
1 Replies

4. Solaris

doubt reg prstat command

Hi, Can anyone explain me what is RSS time in the prstat output. In the below example 93M is total process size(correct me if am wrong ) what abt 58M? 1693 root 93M 58M cpu1 0 10 4:11:02 0.8% java/35 (2 Replies)
Discussion started by: rogerben
2 Replies

5. Solaris

doubt reg mailx command

Hi, Am trying to send mail from solaris host to my mailbox, but while executing mailx command am getting the follow error.Is this syntax corect? #mailx -s "subject" <myid> The flags you gave are used only when sending mail. (1 Reply)
Discussion started by: rogerben
1 Replies

6. Shell Programming and Scripting

Help with egrep command

Hi All, I am using egrep command to search one pattern. Following is the command i am using egrep -i "ACL*" filename but its also giving me the records which do not contain ACL. any help would be appreciated. Regards, Sam (3 Replies)
Discussion started by: sam25
3 Replies

7. Shell Programming and Scripting

Reg expressions

Hi, I would like to grep for a string within a tag, can someone provide some assistance in how to do it? So I would like to use the grep command to find a string like: <tag>sometext<tag> because the sometext can be any number of characters or an type of number or lettering, what expression... (1 Reply)
Discussion started by: cyberfrog
1 Replies

8. Shell Programming and Scripting

Bash script - coloring reg. expressions in text

Hi all, is there anyone good at bash who will help me? I need to use syntax ${string/pattern/replacement} The problematic part where I am stuck is: #!bin/bash text="A cat is on a mat." exp="cat" newexp="SOMECODEcatSOMECODE" newtext=${${text}/${exp}/${newexp}} == > ERROR "wrong... (4 Replies)
Discussion started by: JohnnyM77
4 Replies

9. Shell Programming and Scripting

Using egrep to output expressions which are not found

Hi, Im using the below command to search a file for multiple expressions if the 4th expression doesnt exist the command simply lists what it can find and ignores what it cant. Is there any way to get the command to output an error or a message if it cant find the 4th expression to a file? ... (16 Replies)
Discussion started by: 02JayJay02
16 Replies

10. Shell Programming and Scripting

Problems with reg.-expressions in a awk-search-pattern

Hi, i have some problems with regular expressions in a awk search pattern. what i want to do: i want to calculate the mean-value in the time from 00:00 to 06:00 how my data looks like: .... 04/01/13-01:40 670992 54802 80711 116460 156177 04/01/13-01:50 703725 60150 85498 ... (3 Replies)
Discussion started by: IMPe
3 Replies
ZGREP(1)						      General Commands Manual							  ZGREP(1)

NAME
zgrep - search possibly compressed files for a regular expression SYNOPSIS
zgrep [ grep_options ] [ -e ] pattern filename... DESCRIPTION
Zgrep is used to invoke the grep on compress'ed or gzip'ed files. All options specified are passed directly to grep. If no file is speci- fied, then the standard input is decompressed if necessary and fed to grep. Otherwise the given files are uncompressed if necessary and fed to grep. If zgrep is invoked as zegrep or zfgrep then egrep or fgrep is used instead of grep. If the GREP environment variable is set, zgrep uses it as the grep program to be invoked. For example: for sh: GREP=fgrep zgrep string files for csh: (setenv GREP fgrep; zgrep string files) AUTHOR
Charles Levert (charles@comm.polymtl.ca) SEE ALSO
grep(1), egrep(1), fgrep(1), zdiff(1), zmore(1), znew(1), zforce(1), gzip(1), gzexe(1) ZGREP(1)
All times are GMT -4. The time now is 11:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy