10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi everyone,
I'm looking for a grep command to match the following pattern from a file:
<EGS>10234567<EGS>
I used this following command to do this:
grep -E '^<EGS>{8}<EGS>' test.txt
In output I got:
<EGS>10234567<EGS>
Till now it work, but if I add something at the end of the line... (2 Replies)
Discussion started by: Arnaudh78
2 Replies
2. UNIX for Beginners Questions & Answers
Hello guys,
Here i am writing a script in bash to check for a valid URL from a file using regex
This is my input file
http://www.yahoo.commmmmm
http://www.google.com
https://www.gooogle.co
www.test6.co.in
www.gmail.com
www.google.co
htt://www.money.com
http://eeeess.google.com... (2 Replies)
Discussion started by: Meeran Rizvi
2 Replies
3. Shell Programming and Scripting
I have the following line of code that works wonders. I just don't completely understand it as I am just starting to learn regex. Can you help me understand exactly what is happening here?
find . -type f | grep -v '^\.$' | sed 's!\.\/!!' (4 Replies)
Discussion started by: trogdortheburni
4 Replies
4. Shell Programming and Scripting
Hello people!
I would like to create one script following this stage
I have one directory with 100 files
File001
File002
...
File100
(This is the format of content of the 100 files)
2012/03/10 12:56:50:221875936 1292800448912 12345 0x00 0x04 0
then I have one... (0 Replies)
Discussion started by: Abv_mx81
0 Replies
5. Shell Programming and Scripting
How to match lines that don't contain a patern in regex it self, without using the -v option of grep? (15 Replies)
Discussion started by: vistastar
15 Replies
6. Shell Programming and Scripting
Why is only hello3 being printed? There must be some kind of syntax problem because the file list definitely includes all the file extensions line by line.
#!/bin/bash
find '/home/myuser/folder/' -name '*.c' -type f | while read F
do
if ] # if the file name ends in .txt.c
then
... (6 Replies)
Discussion started by: cyler
6 Replies
7. UNIX for Dummies Questions & Answers
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 a guide.
ls -aLl /bin | grep "\(x\)"
Which works, just highlights 'x' where ever, when ever.
I'm trying to to get (?:) to work but... (4 Replies)
Discussion started by: MykC
4 Replies
8. Shell Programming and Scripting
Hi, all: I have a question about "cleaning up" a huge file with regular expression(s) and sed:
The init file goes like this:
block1,blah-blah-blah-blah,numseries1,numseries2,numseries3,numseries4
block2,blah-blah-blah-blah-blah,numseries,numseries2,numseries3,numseries4
...... (3 Replies)
Discussion started by: yomaya
3 Replies
9. UNIX for Dummies Questions & Answers
Hello everybody,
I'd like to know how is it I should write a regex in unix to match a string not followed by another string (anywhere in the line).
To be more specific, I want to find lines where "drop table" is found, but not followed anywhere in the line by the character "&".
For... (3 Replies)
Discussion started by: mvalonso
3 Replies
10. Shell Programming and Scripting
Hello all,
I have a situation where I have a web root directory with a few thousand users spread out into 100 subdirectories in a 00/firstname.lastname, 01/firstname.lastname, etc. hierarchy. I suddenly need to make sure that each of these user directories contains a default index.html file... (6 Replies)
Discussion started by: dkaplowitz
6 Replies