 <p>You have a space on the end of your variable, and you've set IFS so that it's not being removed as part of word splitting. Here's a simplified test case that exibits your problem:</p> <pre><code>IFS=$'\r\n' value=$(echo "hello - world" | cut -d - -f 1) [ $value = hello ] &amp;&amp; echo "works" || echo "fails" </code></pre> <p>The simplest solution is to cut your variables before the first space, rather than after the space but before the dash:</p> <pre><code>boolser=($(getsebool -a | grep $serv | cut -d ' ' -f1)) </code></pre>