{"id":963,"date":"2010-06-23T00:25:13","date_gmt":"2010-06-22T15:25:13","guid":{"rendered":"http:\/\/livedevil.net\/?p=963"},"modified":"2010-06-23T00:25:13","modified_gmt":"2010-06-22T15:25:13","slug":"powershell-%eb%85%bc%eb%a6%ac-%eb%b9%84%ea%b5%90-%ec%97%b0%ec%82%b0%ec%9e%90-logical-comparison-operators","status":"publish","type":"post","link":"https:\/\/talsu.net\/?p=963","title":{"rendered":"Powershell \ub17c\ub9ac, \ube44\uad50 \uc5f0\uc0b0\uc790 (Logical, Comparison Operators)"},"content":{"rendered":"<p>Powershell \uc758 \ub17c\ub9ac \uc5f0\uc0b0\uc790, \ube44\uad50 \uc5f0\uc0b0\uc790\ub294 \ubcf4\ud3b8\uc801\uc73c\ub85c \ub9ce\uc774 \uc0ac\uc6a9 \ub418\ub294 \ud2b9\uc218\ubb38\uc790 (&gt; , &lt;, =, &amp;, &#8230;) \ub4e4\uc744 \uc0ac\uc6a9\ud558\uc9c0 \uc54a\uace0 -[keyword] \ud615\ud0dc\ub85c \uc0ac\uc6a9 \ub41c\ub2e4.<\/p>\n<p>\ub4e4\uc5b4\uac00\uae30 \uc804\uc5d0 Powershell \uc5d0\uc11c bool \uac12\uc740 <strong>$true, $false<\/strong> \ub85c \ud45c\ud604 \ud560 \uc218 \uc788\uc74c\uc744 \uc219\uc9c0 \ud558\uc790<\/p>\n<h2>\ub17c\ub9ac \uc5f0\uc0b0\uc790<\/h2>\n<p>bool \ud0c0\uc785\uc744 \uc5f0\uc0b0\ud558\uc5ec bool \uac12\uc744 \ubc18\ud658\ud568<\/p>\n<p><strong>-and<\/strong> : \ub17c\ub9ac\uacf1<\/p>\n<pre class=\"lang:ps decode:true\">\n$true -and $true\t# True\n$true -and $false\t# False\n$false -and $true\t# False\n$false -and $false\t# False\n<\/pre>\n<p><strong>-or<\/strong> : \ub17c\ub9ac\ud569<\/p>\n<pre class=\"lang:ps decode:true\">\n$true -or $true     # True\n$true -or $false\t# True\n$false -or $true\t# True\n$false -or $false\t# False\n<\/pre>\n<p><strong>-xor<\/strong> : \ubca0\ud0c0\uc801 \ub17c\ub9ac\ud569<\/p>\n<pre class=\"lang:ps decode:true\">\n$true -xor $true\t# False\n$true -xor $false\t# True\n$false -xor $true\t# True\n$false -xor $false\t# False\n<\/pre>\n<p><strong>-not, !<\/strong> : \ubc18\ub300<\/p>\n<pre class=\"lang:ps decode:true\">\n-not $true\t\t# False\n-not $false\t\t# True\n! $true\t\t\t# False\n! $false\t\t# True\n<\/pre>\n<h2>\ube44\ud2b8 \ub17c\ub9ac \uc5f0\uc0b0\uc790<\/h2>\n<p>\uc785\ub825 \uac12\uc744 \ube44\ud2b8 \ub2e8\uc704\ub85c \uc5f0\uc0b0\ud55c\ub2e4.<br \/>\n\ub17c\ub9ac \uc5f0\uc0b0\uc790 \uc55e\uc5d0 &#8216;b&#8217;\ub97c \ubd99\ud600 \ube44\ud2b8 \ub17c\ub9ac \uc5f0\uc0b0\uc790\ub85c \uc0ac\uc6a9 \ud55c\ub2e4. (<strong>-band, -bor, -bxor, -bnot<\/strong>)<\/p>\n<pre class=\"lang:ps decode:true\">\n0xFF -band 0x0A # 0x0A (10)\n\n0x0F -bor 0xF0\t# 0xFF (255)\n\n0xFF -bxor 0xF0 # 0x0F (15)\n\n-bnot 0\t\t# -1\n<\/pre>\n<h2>\ube44\uad50 \uc5f0\uc0b0\uc790<\/h2>\n<p>\ub450 \uac12\uc744 \ube44\uad50 \ud55c\ub2e4. \uc55e\uc5d0 &#8216;c&#8217;\uac00 \ubd99\ub294 \uba85\ub839\uc5b4 \ub4e4\uc740 \ub300\uc18c\ubb38\uc790\ub97c \uad6c\ubd84 \ud55c\ub2e4.<\/p>\n<p><strong>-eq <\/strong>: \uac19\ub2e4  (<strong><span style=\"color: #ff0000;\">eq<\/span><\/strong>ual) \ub300\uc18c\ubb38\uc790 \uad6c\ubd84\ud558\uc9c0 \uc54a\uc74c<br \/>\n<strong>-ceq<\/strong> : \uac19\ub2e4 \ub300\uc18c\ubb38\uc790 \uad6c\ubd84<\/p>\n<pre class=\"lang:ps decode:true\">\n\"ABC\" -eq \"abc\"\t\t# True\n\"ABC\" -eq \"ABC\"\t\t# True\n\n\"ABC\" -ceq \"abc\"\t# False\n\"ABC\" -ceq \"ABC\"\t# True\n<\/pre>\n<p><strong>-ne<\/strong> : \uac19\uc9c0 \uc54a\ub2e4 (<strong><span style=\"color: #ff0000;\">n<\/span><\/strong>ot <strong><span style=\"color: #ff0000;\">e<\/span><\/strong>qual). \ub300\uc18c\ubb38\uc790 \uad6c\ubd84\ud558\uc9c0 \uc54a\uc74c<br \/>\n<strong>-cne<\/strong> : \uac19\uc9c0 \uc54a\ub2e4. \ub300\uc18c\ubb38\uc790 \uad6c\ubd84<\/p>\n<pre class=\"lang:ps decode:true\">\n\"ABC\" -ne \"abc\"\t\t# False\n\"ABC\" -ne \"ABC\"\t\t# False\n\n\"ABC\" -cne \"abc\"\t# True\n\"ABC\" -cne \"ABC\"\t# False\n<\/pre>\n<p><strong>-lt , -clt<\/strong> : \ubcf4\ub2e4 \uc791\ub2e4 (<strong><span style=\"color: #ff0000;\">l<\/span><\/strong>ess <strong><span style=\"color: #ff0000;\">t<\/span><\/strong>han)<\/p>\n<pre class=\"lang:ps decode:true\">\n\"A\" -lt \"B\"\t\t# True\n100 -lt 50\t\t# False\n<\/pre>\n<p><strong>-gt , -cgt<\/strong> : \ubcf4\ub2e4 \ud06c\ub2e4 (<span style=\"color: #ff0000;\"><strong>g<\/strong><\/span>reater <strong><span style=\"color: #ff0000;\">t<\/span><\/strong>han)<\/p>\n<pre class=\"lang:ps decode:true\">\n\"A\" -gt \"B\"\t\t# False\n100 -gt 50\t\t# True\n<\/pre>\n<p><strong>-le , -cle<\/strong> : \ubcf4\ub2e4 \uc791\uac70\ub098 \uac19\ub2e4 (<strong><span style=\"color: #ff0000;\">l<\/span><\/strong>ess than or <strong><span style=\"color: #ff0000;\">e<\/span><\/strong>qual to)<\/p>\n<pre class=\"lang:ps decode:true\">\n100 -le 50\t\t# False\n25 -le 25\t\t# True\n<\/pre>\n<p><strong>-ge, -cge<\/strong> : \ubcf4\ub2e4 \ud06c\uac70\ub098 \uac19\ub2e4. (<strong><span style=\"color: #ff0000;\">g<\/span><\/strong>reater than or <strong><span style=\"color: #ff0000;\">e<\/span><\/strong>qual to)<\/p>\n<pre class=\"lang:ps decode:true\">\n100 -ge 50\t\t# True\n25 -ge 25\t\t# True\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Powershell \uc758 \ub17c\ub9ac \uc5f0\uc0b0\uc790, \ube44\uad50 \uc5f0\uc0b0\uc790\ub294 \ubcf4\ud3b8\uc801\uc73c\ub85c \ub9ce\uc774 \uc0ac\uc6a9 \ub418\ub294 \ud2b9\uc218\ubb38\uc790 (&gt; , &lt;, =, &amp;, &#8230;) \ub4e4\uc744 \uc0ac\uc6a9\ud558\uc9c0 \uc54a\uace0 -[keyword] \ud615\ud0dc\ub85c \uc0ac\uc6a9 \ub41c\ub2e4. \ub4e4\uc5b4\uac00\uae30 \uc804\uc5d0 Powershell \uc5d0\uc11c bool \uac12\uc740 $true, $false \ub85c \ud45c\ud604 \ud560 \uc218 \uc788\uc74c\uc744 \uc219\uc9c0 \ud558\uc790 \ub17c\ub9ac \uc5f0\uc0b0\uc790 bool \ud0c0\uc785\uc744 \uc5f0\uc0b0\ud558\uc5ec bool \uac12\uc744 \ubc18\ud658\ud568 -and : \ub17c\ub9ac\uacf1 $true -and $true # True [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"spay_email":""},"categories":[27],"tags":[78,166,481,195],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/pXV5a-fx","_links":{"self":[{"href":"https:\/\/talsu.net\/index.php?rest_route=\/wp\/v2\/posts\/963"}],"collection":[{"href":"https:\/\/talsu.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/talsu.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/talsu.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/talsu.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=963"}],"version-history":[{"count":0,"href":"https:\/\/talsu.net\/index.php?rest_route=\/wp\/v2\/posts\/963\/revisions"}],"wp:attachment":[{"href":"https:\/\/talsu.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=963"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/talsu.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=963"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/talsu.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=963"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}