<div dir="ltr">Thanks for all of the responses. Sounds like the trainer was just trying to impress good habits. </div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Apr 15, 2015 at 11:01 AM, Rob Funk <span dir="ltr"><<a href="mailto:rfunk@funknet.net" target="_blank">rfunk@funknet.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">zach villers wrote:<br>
> Is there a difference between;<br>
><br>
> ls -l | grep ^...s<br>
><br>
> AND<br>
><br>
> ls -l | grep "^...s"<br>
><br>
> *trying to find files with setuid permission*<br>
><br>
> A trainer told me using quotes with the grep statement was necessary,<br>
> but it doesn't seem to be.<br>
<br>
</div></div>Without the quotes, the shell will try to interpret your search<br>
pattern in its own ways that have nothing to do with the search you're<br>
trying to do. In this case that's harmless (nothing for it to<br>
interpret), but if there are spaces or dollar signs or vertical-bars<br>
or ampersands or question marks or asterisks or<br>
less-than/greater-thans... and so on. There are many many symbols that<br>
might be in a regular expression that a shell might interpret itself.<br>
It's safest just to ALWAYS put it in quotes.<br>
<br>
Then there's the question of which quotes. With double-quotes, the<br>
shell will still try to interpret dollar-signs. You're safest using<br>
double-quotes.<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
colug-432 mailing list<br>
<a href="mailto:colug-432@colug.net">colug-432@colug.net</a><br>
<a href="http://lists.colug.net/mailman/listinfo/colug-432" target="_blank">http://lists.colug.net/mailman/listinfo/colug-432</a><br>
</div></div></blockquote></div><br></div>