Bash Expressions

From NovaOrdis Knowledge Base
Revision as of 01:35, 28 May 2016 by Ovidiu (talk | contribs) (Created page with "=Internal= * bash =Difference between <tt>-a</tt> and <tt>&&</tt>= If want to combine the results of multiple command executions in an <tt>if</tt> conditi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Internal

Difference between -a and &&

If want to combine the results of multiple command executions in an if condition, use &&</t>, not -a.

Example:

if grep "something" /file1.txt && grep "something" /file2.txt' then
    # "something" exists in both files ...
fi