Search Results

Search: Posts Made By: MykC
4,648
Posted By MykC
You might already have your answer, but for my...
You might already have your answer, but for my own curosity I'm just trying to understand it as well.

Input: File
Output = Input - lines that contain the specified sequences.
Sequences: You can...
9,337
Posted By MykC
Ok, cool. You gave me some insight. For...
Ok, cool. You gave me some insight. For reference, the below line returns lines with exactly 3 matches if 'x' in the entire line.
3 can be replaced with any positive integer.
'x' can be replaced by...
9,337
Posted By MykC
Hello, I apologize if the message was unclear. ...
Hello, I apologize if the message was unclear.

The problem is: I want to use the following advanced regular expression syntax "(?:)" which represents grouping without backreference.
Related...
9,337
Posted By MykC
| help | unix | grep (GNU grep) 2.5.1 | advanced regex syntax
Hello,

I'm working on unix with grep (GNU grep) 2.5.1. I'm going through some of the newer regex syntax using Regular Expression Reference - Advanced Syntax...
10,458
Posted By MykC
Hey, thanks that was exactly what I was looking...
Hey, thanks that was exactly what I was looking for. I'm just trying to work through the logic for the grep part:

^[^x]* = match characters that aren't 'x' at the beginning of a line, zero or more...
10,458
Posted By MykC
Thanks, that definitely does it. I haven't...
Thanks, that definitely does it.

I haven't gotten around to awk and sed so I'm still unsure on how they operate exactly. This is mainly an exercise for myself to understand the basics on regular...
10,458
Posted By MykC
Ok, cool. grep -o prints just the matching...
Ok, cool.

grep -o prints just the matching sting on its own line.
[^ ]*$ matches any number of non-space, non-tab characters in a sequence that are at the of a line.

So, this seems good for...
15,832
Posted By MykC
Ok, so if I'm trying to use grep to execute the...
Ok, so if I'm trying to use grep to execute the regular expression:

^(.*)(\r?\n\1)+$

To remove duplicate lines that are in sequence, then its simply a regular expression that goes beyond what...
10,458
Posted By MykC
| help | unix | grep - Can I use grep to return a string with exactly n matches?
Hello,

I looking to use grep to return a string with exactly n matches.

I'm building off this:


ls -aLl /bin | grep '^.\{9\}x' | tr -s ' '




-rwxr-xr-x 1 root root 632816 Nov 25...
5,605
Posted By MykC
| Help | unix | grep | sort | uniq - Different output from what I thought would be the same
Hello,

I'm having an consistency issue....


grep 'a' /usr/share/dict/words


1) This will highlight every 'a' in each word.


grep 'a\{1,\}' /usr/share/dict/words


2) This...
3,770
Posted By MykC
Hey, thanks for the help. I did implement...
Hey, thanks for the help.

I did implement the repetion for safety which prevents sequences else where matching 'x ' from being flagged.

Ok, so when I use ls -aLl, it will replace all the...
3,770
Posted By MykC
Help | unix | grep | regular expression
I have the following code:
ls -al /bin | tr -s ' ' | grep 'x[ ]'
ls -al: Lists all the files in a given director such as /bin
tr -s ' ': removes additional spaces between characters so that there...
2,316
Posted By MykC
Hey, thanks for the reply. sed is a pretty...
Hey, thanks for the reply. sed is a pretty powerful tool.

I was able to do it with tr as well:

ls -l | tr -s ' '

Still wondering if its possible to do something similar with grep?
2,316
Posted By MykC
HELP | unix | regular expression - How to represent two whitespaces?
ls -l generates something like...

-rwxr-xr-x 1 root root 19304 Jan 21 2009 true
-rwsr-xr-x 1 root root 40208 Jan 21 2009 umount
-rwxr-xr-x 1 root root 22336 Jan 21 2009 uname...
15,832
Posted By MykC
Help | Unix | grep | regular expression | backreference | Syntax/Logic
Hello,

I'm working on learning regular expressions and what I can do with them. I'm using unix to and its programs to experiment and learn what my limitations are with them.

I'm working on...
15,281
Posted By MykC
Hey, thanks for the help, such a silly error.
Hey, thanks for the help, such a silly error.
15,281
Posted By MykC
Syntax Help | unix | grep | regular expression | repetition
Hello,

This is my first post so, Hello World! Anyways, I'm learning how to use unix and its quickly become apparent that a strong foundation in regular expressions will make things easier. I'm...
Showing results 1 to 17 of 17

 
All times are GMT -4. The time now is 08:31 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy