Thanks for the tip. I'm not quite sure how it makes it easier, as I still need my for loop to generate the search string (because i will not specify each individual hour to be searched for, just the start and end like starthr=18 and endhr=20 would search from 6pm till 8pm), but I guess it would make the code cleaner.
Anyway sadly it seems I spoke too soon. Although I don't get an error the egrep isn't working still.
it doesn't return any results because it is literally issuing that command as opposed to the
that I want.
This is what I updated my code to:
(Only this line was editted)
Clearly I am doing something wrong with the single quotes/brackets in the timestr variable. I can probably get around this by using egrep -e instead of the single quotes and brackets to form the command, however I'm interested to know what I am doing wrong.
Any ideas? Sorry if it's something stupid, as you can tell I'm not a scripter.
I'd like to grep a pattern of a version number as
*_number.number.number
number should be digit
my grep is
|egrep '^*++\.+'
It works for V_3.2.1 or V _5.3.2 but not with V_43.6.543 !!!!!
How can I specify any repetition of digit in the ?
thanks, (4 Replies)
hey im having a problem with my script
replace="dir/another_dir"
sed s/something/$replace/g
is there a way i can get around this problem without using the escape string character "\" (2 Replies)
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)
Hi All,
I am having a query regarding the usage of egrep command.
i am having two unix environmanets in environment when i am using
"egrep -f" it is working fine and other unix environment i am getting a syntax error.
Please let me know if i need to set any environmane variables.
... (12 Replies)
Hi
Following is an example line.
echo "192.22.22.22 \"33dffwef\" 200 300 dsdsd" | sed "s:\(\ *\ \):\1:"
I want it's output to be
200
However this is not the case. Can you tell me how to do it? I don't want to use AWK for this. Secondly, how can i fetch just 300? Should I use "\2"... (3 Replies)
Hi All,
Here is my question.
I have two files, file1.txt and file2.txt. I need the line number (index number) of file2.txt where the words in file1.txt appear. But they have to be in the same order as file1.txt. In example,
file1.txt
Z
K
A
...
T
file2.txt
W
A
Q
R (6 Replies)
cat /tmp/inventory.csv|grep AARP|egrep -v "T11|12.4\(7\)"
how do i exclude in addition to above 12.4\(3\)
I have tried adding this in i.e
-v "T11|12.4\(7\)|12.4\(3\)"
but it did not work (3 Replies)
Hello folks,
Here's how my current egrep command works:
egrep "NY|DC|LA|VA|MD" state_data.txt
I am planning to use a file to enter all allowable state values like say a new state_names.lookup with the following data:
NY
DC
LA
VA
MD
egrep "`cat state_names.lookup`"... (6 Replies)
Hi Guys,
I need hepl on egrep commnad
I have one file and i need grep only specific lines..
EX:
2012-04-01 02:15:14 w
2012-04-01 02:15:14 w
2012-04-01 02:15:14 w
2012-10-26 02:15:14 w
2012-04-01 02:15:14 w
2012-10-26 02:15:14 w
2012-10-26 02:15:14 w
2012-10-26 03:18:56 M... (1 Reply)
my file is below
REREGISTER is something to Failed to create the request
Failed to create the request in not easy
I know how REREGISTERcommand i run is
egrep 'REREGISTER|Failed|to|create|the|request' test1
expected output
REREGISTER is something to Failed to create the request
i should... (2 Replies)
Discussion started by: mirwasim
2 Replies
LEARN ABOUT MOJAVE
zipgrep
ZIPGREP(1L)ZIPGREP(1L)NAME
zipgrep - search files in a ZIP archive for lines matching a pattern
SYNOPSIS
zipgrep [egrep_options] pattern file[.zip] [file(s) ...] [-x xfile(s) ...]
DESCRIPTION
zipgrep will search files within a ZIP archive for lines matching the given string or pattern. zipgrep is a shell script and requires
egrep(1) and unzip(1L) to function. Its output is identical to that of egrep(1).
ARGUMENTS
pattern
The pattern to be located within a ZIP archive. Any string or regular expression accepted by egrep(1) may be used. file[.zip] Path
of the ZIP archive. (Wildcard expressions for the ZIP archive name are not supported.) If the literal filename is not found, the
suffix .zip is appended. Note that self-extracting ZIP files are supported, as with any other ZIP archive; just specify the .exe
suffix (if any) explicitly.
[file(s)]
An optional list of archive members to be processed, separated by spaces. If no member files are specified, all members of the ZIP
archive are searched. Regular expressions (wildcards) may be used to match multiple members:
* matches a sequence of 0 or more characters
? matches exactly 1 character
[...] matches any single character found inside the brackets; ranges are specified by a beginning character, a hyphen, and an end-
ing character. If an exclamation point or a caret (`!' or `^') follows the left bracket, then the range of characters within
the brackets is complemented (that is, anything except the characters inside the brackets is considered a match).
(Be sure to quote any character that might otherwise be interpreted or modified by the operating system.)
[-x xfile(s)]
An optional list of archive members to be excluded from processing. Since wildcard characters match directory separators (`/'),
this option may be used to exclude any files that are in subdirectories. For example, ``zipgrep grumpy foo *.[ch] -x */*'' would
search for the string ``grumpy'' in all C source files in the main directory of the ``foo'' archive, but none in any subdirectories.
Without the -x option, all C source files in all directories within the zipfile would be searched.
OPTIONS
All options prior to the ZIP archive filename are passed to egrep(1).
SEE ALSO egrep(1), unzip(1L), zip(1L), funzip(1L), zipcloak(1L), zipinfo(1L), zipnote(1L), zipsplit(1L)URL
The Info-ZIP home page is currently at
http://www.info-zip.org/pub/infozip/
or
ftp://ftp.info-zip.org/pub/infozip/ .
AUTHORS
zipgrep was written by Jean-loup Gailly.
Info-ZIP 20 April 2009 ZIPGREP(1L)