public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] bash script question
@ 2014-08-18  8:54 Adam Carter
  2014-08-18  9:42 ` wraeth
  0 siblings, 1 reply; 9+ messages in thread
From: Adam Carter @ 2014-08-18  8:54 UTC (permalink / raw
  To: gentoo-user@lists.gentoo.org

[-- Attachment #1: Type: text/plain, Size: 497 bytes --]

I want to use an if/then that tests for the existence of a string in 4
files. Usually I do this by checking the exit code of grep, when i'm
checking a single file. However, I cant get the syntax right for multiple
checks.



To troubleshoot I’ve dropped back to just checking two files, and i’ve
tried things like



If [ $(grep blah file1.txt) –a $(grep blah file2.txt) ]; then



But this matches if grep fails both times as well as when it matches both
time. Any ideas?

[-- Attachment #2: Type: text/html, Size: 715 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-08-18 14:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-18  8:54 [gentoo-user] bash script question Adam Carter
2014-08-18  9:42 ` wraeth
2014-08-18 11:29   ` Stroller
2014-08-18 11:58     ` wraeth
2014-08-18 13:53       ` Stroller
2014-08-18 12:16     ` Kerin Millar
2014-08-18 14:02       ` Stroller
2014-08-18 14:18         ` Kerin Millar
2014-08-18 14:28           ` Kerin Millar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox