Hi all,
I've got a strangely acting egrep -f.
Example:
$ egrep -f ~/tmp/tmpgrep2 orig_20_L_A_20090228.txt | wc -l
3
$ for lines in `cat ~/tmp/tmpgrep2` ; do egrep $lines orig_20_L_A_20090228.txt ; done | wc -l
12
Could someone give me a hint what could be the problem?
No, the files did not changed between executions. The expected ...
Hi,
O/S = Fedora Code 9.
I have a number of files hiding in my LANG=en_US:UTF-8 filesystem that have been uploaded with unrecognisable characters in their filename.
I need to search the filesystem and return all filenames that have at least one character that is not in the standard range (a-zA-Z0-9 and .-_ etc.)
I have been trying t...
Hi,
I am trying to use the cscope-indexer script. But I want to know how to change the following to include *.mm and *.java files?
egrep -i '\.([chly](xx|pp)*|cc|hh)$' | \
sed -e '/\/CVS\//d' -e '/\/RCS\//d' -e 's/^\.\///' | \
sort > $LIST_FILE
I tried
egrep -i '\.([chly](xx|pp)*|cc|hh|mm|java)$'
it does not work.
...
hello all
i need in my application the feathers that the good old egrep and wget give me , but i can't execute them as
separate process i need them as embedded functions in my application
is there any way to do that ? cross platform and c++
...
I would like to find the files containing specific string under linux.
I tried something like but could not succeed:
find . -name *.txt | egrep mystring
...
I have a hunch that I should probably be using ack or egrep instead, but what should I use to basically look for
<?
at the start of a file? I'm trying to find all files that contain the php short open tag since I migrated a bunch of legacy scripts to a relatively new server with the latest php 5.
I know the regex would probably be '/...
The file i am working with (oraInst.loc) looks like this:
inventory_loc=/u01/app/ORAENV/oracle/oraInventory
inst_group=dba
I need to use a regular expression to grab the value between app/ and /oracle. In this case it will be ORAENV but it could be any alphanumeric string of any case and length but with no spaces.
From what I have re...
Hello,
Is it possible to do a grep with keywords stored in the array.
Here is the possible code snippet... Please correct it
args=("key1" "key2" "key3")
cat file_name |while read line
echo $line | grep -q -w ${args[c]}
done
At the moment, I can search for only one keyword. I would like to search for all the keywords which is stored...
Hello!
I was wondering if, with egrep ((GNU grep) 2.5.1), I can select a part of the matched text, something like:
grep '^([a-zA-Z.-]+)[0-9]+' ./file.txt
So I get only the part which matched, between the brackets, something like
house.com
Instead of the whole line like I usually get:
house.com112
Assuming I have a line with h...
Hi, i got a weird problem regarding egrep and pipe
I tried to filter a stream containing some lines who start with a topic name, such as
"TICK:this is a tick message\n"
When I try to use egrep to filter it :
./stream_generator | egrep 'TICK' | ./topic_processor
It seems that the topic_processor never receives any messages
However, wh...
Ok guys.. I have a HTML i need to parse into a php script and mangle the data around abit. For best explanation I will show how I would do this in a bash script using awk, grep, egrep, and sed through a god awful set of pipes. Commented for clarity.
curl -s http://myhost.net/mysite/ | \ # retr the document
awk '/\/\a...
I have a text file where some lines have a character at the beginning and some lines don't. I want to print the text file to screen, excluding the lines that don't have a character at the beginning.
Can I do this with grep?
...
My source tree contains several directories which are using git source control and I need to tarball the whole tree excluding any references to the git metadata or custom log files.
I thought I'd have a go using a combo of find/egrep/xargs/tar but somehow the tar file contains the .git directories and the *.log files.
This is what I ha...
Why can't I match the string
"1234567-1234567890"
with the given regular expression
\d{7}-\d{10}
with egrep from the shell like this:
egrep \d{7}-\d{10} file
?
...
hi,
what is the option with grep or egrep through which we can search from bottom to up of a file
normally they works in the top to bottom
...
I'm looking for a regex that finds all words in a list that do not have characters next to each other that are the same. (this is an exercise)
So abcdef is printed, but aabcdef is not.
I tried both
egrep "^((.)[^\1])*$"
and
egrep "^((.)[^\2])*$" words
but, other than being not sure which one would be right, they don't work.
I k...
Can someone explain why this code doesn't work as expected?
I would expect it only to match the first character, and it does with literal characters, but the wildcard (.) and characters classes behave strangely:
I use -o just to demonstrate exactly how things are matching, it doesn't change what matches at all.
$ echo foo | grep -o '^....
I have a program that returns something like this:
status: playing
artURL: http://beta.grooveshark.com/static/amazonart/m3510922.jpg
estimateDuration: 29400
calculatedDuration: 293000
albumName: This Is It
position: 7291.065759637188
artistName: Michael Jackson
trackNum: 13
vote: 0
albumID: 3510922
songName: Billie Jean
artistID: 39
son...
I have file something like this
1111,K1
2222,L2
3333,LT50
4444,K2
1111,LT50
5555,IA
6666,NA
1111,NA
2222,LT10
Output that is need
1111,K1,LT50,NA
2222,L2,LT10
3333,LT50
4444,K2
5555,IA
6666,NA
1 st Column number may repeat anytime but output that i need is sort and uniq
...
I have this working regex (tested on regex coach):
\n[\s]*[0-9]*[\s]*[0-9]*(\.)?[0-9]*(e\+)?[0-9]*
that is supposed to pick up the first 2 columns of this file
http://wwwhomes.uni-bielefeld.de/achim/highly.txt
I read through the man pages, and it says that ^ will match at the beggining of the line so I replaced \n with ^
but egrep i...