<div dir="ltr">Hey all - it appears that the problem lies with BSD sed and Mac OSX's sed doesn't support tabs in the same way as you're using them.<div><br></div><div>I've talked with some homebrew people - we're going to see if we can't alias your sed to use gnu-sed (for os x).</div>
<div><br></div><div>G</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Thu, Feb 27, 2014 at 4:36 PM, Giordon Stark <span dir="ltr"><<a href="mailto:kratsg@gmail.com" target="_blank">kratsg@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hey,<br><br>I used Homebrew to install bash-completion (1.3 I believe) via<br>    `brew install bash-completion`<br>
and added<br><br>  if [ -f $(brew --prefix)/etc/bash_completion ]; then<br><br>    . $(brew --prefix)/etc/bash_completion<br>
<br>  fi<br><br>to my ~/.bash_profile. I noticed that some of my ssh Hosts were not autocompleting. Inspecting it further, it appears that any host starting with the letter 't' gets stripped for the autocompletion. I made a test file:<br>

<br>    Host tier3<br>    User kratsg<br>    IdentityFile ~/.ssh/(a file)<br><br>then ran the regex against it:<br><div><br></div><div>







<p>sed -ne 's/^[ \t]*[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\{0,1\}['"$'\t '"']\{1,\}\([^#*?]*\)\(#.*\)\{0,1\}$/\2/p' "testfile"</p><p>and this outputted 'ier3' rather than 'tier3' as expected. It appears the regex is not totally valid but I've tried to debug it... and found that the following works</p>

<p>







</p><p>sed -ne 's/^[ \t]*[Hh][Oo][Ss][Tt]\([Nn][Aa][Mm][Ee]\)\{0,1\}['"$ "']\{1,\}\([^#*?]*\)\(#.*\)\{0,1\}$/\2/p' "testfile"</p><p>outputting 'tier3' as expected. I removed the '\t ' from the block containing the $. It seems like a bug.</p>

<p>Thanks and let me know,</p><p>Giordon</p></div></div>
</blockquote></div><br></div>