<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; ">Yes, I am running Leopard 10.5.1 and there is actually a white space in front of the name.<div>I assume that your dscl . -read /Users/$USER RealName |sed 's/RealName: //' works on Tiger but it does not</div><div>work on Leopard.</div><div><br class="webkit-block-placeholder"></div><div>There is no trailing white space on Leopard, thus it fails to sed anything.</div><div>The technique I use is overkill.  I could have used <br><div><div><br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre">    </span><span class="Apple-style-span" style="color: rgb(84, 0, 0); ">dscl . -read /Users/$USER RealName | tail -1</span></div><div><br class="webkit-block-placeholder"></div><div>but then I would end up with the name plus a leading white space.</div><div><br class="webkit-block-placeholder"></div><div><span class="Apple-tab-span" style="white-space:pre">    </span>dscl . -read /Users/$USER RealName | tail -1 | sed -e "s/^\ //"</div><div><br class="webkit-block-placeholder"></div><div>That line fishes the real name out of dscl's database, then eliminates the first line altogether and finally removes the leading white space if there is one.</div><div><br class="webkit-block-placeholder"></div><div>Here a snippet from my shell:</div><div><div><br class="webkit-block-placeholder"></div><div><font class="Apple-style-span" face="'Courier New'">mac-mini-intel:Tasks kjanson$ res=`dscl . -read /Users/$USER RealName | tail -1`</font></div><div><font class="Apple-style-span" face="'Courier New'">mac-mini-intel:Tasks kjanson$ echo "'$res'"</font></div><div><font class="Apple-style-span" face="'Courier New'">' Kai Janson'</font></div><div><font class="Apple-style-span" face="'Courier New'">mac-mini-intel:Tasks kjanson$ res=`dscl . -read /Users/$USER RealName | tail -1 | sed -e "s/^\ //"`</font></div><div><font class="Apple-style-span" face="'Courier New'">mac-mini-intel:Tasks kjanson$ echo "'$res'"</font></div><div><font class="Apple-style-span" face="'Courier New'">'Kai Janson'</font></div><div><br></div></div><div>--Kai</div><div><br><div><div>On Nov 29, 2007, at 10:58 AM, Robin Houston wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite">Are you sure? There isn't one on my computer; though I'm still running<br>10.4, so it could be different.<br><br>(You noticed that I added a space after the colon in the regular expression?)<br><br>Robin<br><br>On 29/11/2007, Kai Janson <<a href="mailto:kaijanson@thejeeper.net">kaijanson@thejeeper.net</a>> wrote:<br><blockquote type="cite">There is a leading whitespace<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">On Nov 29, 2007, at 8:14 AM, Robin Houston wrote:<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><blockquote type="cite">On 29/11/2007, Kai Janson <<a href="mailto:kaijanson@thejeeper.net">kaijanson@thejeeper.net</a>> wrote:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">dscl . -read /Users/$USER RealName |sed -e "s/RealName://" -e "s/^<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">\ //" | tail -1<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">I don't understand why that can't just be<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> dscl . -read /Users/$USER RealName |sed 's/RealName: //'<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">?<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Or an alternative approach:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"> perl -le 'print +(getpwuid $<)[6]'<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Robin<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">______________________________________________________________________<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">For new threads USE THIS: <a href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">(threading gets destroyed and the universe will collapse if you don't)<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><a href="http://lists.macromates.com/mailman/listinfo/textmate">http://lists.macromates.com/mailman/listinfo/textmate</a><br></blockquote></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">______________________________________________________________________<br></blockquote><blockquote type="cite">For new threads USE THIS: <a href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a><br></blockquote><blockquote type="cite">(threading gets destroyed and the universe will collapse if you don't)<br></blockquote><blockquote type="cite"><a href="http://lists.macromates.com/mailman/listinfo/textmate">http://lists.macromates.com/mailman/listinfo/textmate</a><br></blockquote><blockquote type="cite"><br></blockquote><br>______________________________________________________________________<br>For new threads USE THIS: <a href="mailto:textmate@lists.macromates.com">textmate@lists.macromates.com</a><br>(threading gets destroyed and the universe will collapse if you don't)<br><a href="http://lists.macromates.com/mailman/listinfo/textmate">http://lists.macromates.com/mailman/listinfo/textmate</a><br></blockquote></div><br></div></div></div></body></html>