GNU bash: Difference between revisions
Jump to navigation
Jump to search
Created page with "== test or [ <ref>http://tldp.org/LDP/abs/html/fto.html</ref>== {| class="wikitable" !Command !Comments |- | -d |file is a directory |}" |
No edit summary |
||
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
== | == Safe bash == | ||
{| class="wikitable" | {| class="wikitable" | ||
!Command | !Command | ||
!Comments | !Comments | ||
|- | |- | ||
| -d | |set -o pipefail | ||
|file is a directory | |returns error if the pipe fails | ||
|- | |||
|set -e | |||
|exit on the first program fail | |||
|} | |||
== test or [ <ref>http://tldp.org/LDP/abs/html/fto.html</ref><ref>http://tldp.org/LDP/abs/html/comparison-ops.html</ref> == | |||
{| class="wikitable" | |||
!Command | |||
!Comments | |||
|- | |||
| -d ''file'' | |||
|''file'' is a directory | |||
|- | |||
| -n ''string'' | |||
|the length of ''string'' is nonzero | |||
|- | |||
|''string1'' != ''string2'' | |||
|''string1'' and ''string2'' are not equal | |||
|} | |} | ||
== References == | |||