On 22 May 2014 14:12, li...@sbt.net.au wrote:
On Wed, May 21, 2014 12:28 pm, pe...@chubb.wattle.id.au wrote:
As you're not using regular expressions, but just strings, fgrep is
the way to do it. fgrep -q '07/2014 15/06/2014
20/06/2014
25/06/2014' part 2 exit 0
Peter, thanks
Amos,
It might be more maintainable to keep the list of patterns in a variable
(line per pattern) then pass it to grep using grep's -f/--file= argument:
PATTERNS=15/06/2014
20/06/2014
25/06/2014
...
grep -q -f (echo $PATTERNS) file2 exit 0
Note the use of double quotes around the variable
On Wed, May 21, 2014 12:28 pm, pe...@chubb.wattle.id.au wrote:
As you're not using regular expressions, but just strings, fgrep is
the way to do it. fgrep -q '07/2014 15/06/2014
20/06/2014
25/06/2014' part 2 exit 0
Peter, thanks
Amos, you've per-emptied my next Q, thanks
I actually should
I have a basic script that includes an exit on a date month condition,
like so:
/snip/
grep -q '07/2014' part2 exit 0
/snip/
I would like to add multiple additional non consecutive individual day
date conditions, like say, 15/06/2014, 20/06, 25/06, like so;
grep -q '07/2014' part2
lists == lists li...@sbt.net.au writes:
lists I have a basic script that includes an exit on a date month
lists condition, like so:
lists /snip/ grep -q '07/2014' part2 exit 0 /snip/
lists I would like to add multiple additional non consecutive
lists individual day date conditions, like say,
grep -q '07/2014' part2 exit 0 grep -q '15/06/2014' part2 exit 0 grep
-q '20/06/2014' part2 exit 0
grep -q '25/06/2014' part2 exit 0
is this the way to do this ?
grep -q -e '15/06/2014' -e '20/06/2014' -e '25/06/2014' file2 exit 0
--
SLUG - Sydney Linux User's Group Mailing List -