[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-core-devel
Subject:    Re: ZSH completion for kdesrc-build
From:       Ivan Čukić <ivan.cukic () kde ! org>
Date:       2014-01-11 20:35:01
Message-ID: CAFkAKBxGxWVRbshn3X=K11ysfQysFvfxt3i4z_qS3HKKbN+0+Q () mail ! gmail ! com
[Download RAW message or body]

You are evil :) Thank you dude!


On 11 January 2014 21:34, Ivan Čukić <ivan.cukic@gmail.com> wrote:

> You are evil :) Thank you dude!
>
>
> On 11 January 2014 17:04, Thiago Macieira <thiago@kde.org> wrote:
>
>> On sábado, 11 de janeiro de 2014 11:38:25, Ivan Čukić wrote:
>> > function _ksrccomp() {
>> >   reply=(`grep identifier kde_projects.xml | sed 's/^[^"]*"//' | sed
>> > 's/".*//' | sort -u`)
>> > }
>>
>> Replace the grep and two sed with just one sed:
>>
>>    reply=(`sed -n 's/.*identifier="\(.*\)".*/\1/p' kde_projects.xml |
>> sort -u`)
>>
>> You can also use zsh expansion modifiers "o" and "u" to sort and uniquify:
>>
>>     reply=(`sed -n 's/.*identifier="\(.*\)".*/\1/p' kde_projects.xml`)
>>     reply=(${(ou)reply})
>>
>> If you want to go further, you can replace the sed with a while read :-)
>>
>> --
>> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>>    Software Architect - Intel Open Source Technology Center
>>       PGP/GPG: 0x6EF45358; fingerprint:
>>       E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
>>
>
>
>
> --
> While you were hanging yourself on someone else's words
> Dying to believe in what you heard
> I was staring straight into the shining sun
>



-- 
Cheerio,
Ivan

--
While you were hanging yourself on someone else's words
Dying to believe in what you heard
I was staring straight into the shining sun

[Attachment #3 (text/html)]

<div dir="ltr">You are evil :) Thank you dude!</div><div \
class="gmail_extra"><br><br><div class="gmail_quote">On 11 January 2014 21:34, Ivan \
Čukić <span dir="ltr">&lt;<a href="mailto:ivan.cukic@gmail.com" \
target="_blank">ivan.cukic@gmail.com</a>&gt;</span> wrote:<br> <blockquote \
class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div dir="ltr">You are evil :) Thank you dude!<br></div><div \
class="gmail_extra"><div><div class="h5"><br><br><div class="gmail_quote"> On 11 \
January 2014 17:04, Thiago Macieira <span dir="ltr">&lt;<a \
href="mailto:thiago@kde.org" target="_blank">thiago@kde.org</a>&gt;</span> wrote:<br> \
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc \
solid;padding-left:1ex"><div>On sábado, 11 de janeiro de 2014 11:38:25, Ivan Čukić \
wrote:<br> &gt; function _ksrccomp() {<br>
&gt;    reply=(`grep identifier kde_projects.xml | sed \
&#39;s/^[^&quot;]*&quot;//&#39; | sed<br> &gt; &#39;s/&quot;.*//&#39; | sort -u`)<br>
&gt; }<br>
<br>
</div>Replace the grep and two sed with just one sed:<br>
<br>
     reply=(`sed -n &#39;s/.*identifier=&quot;\(.*\)&quot;.*/\1/p&#39; \
kde_projects.xml | sort -u`)<br> <br>
You can also use zsh expansion modifiers &quot;o&quot; and &quot;u&quot; to sort and \
uniquify:<br> <br>
      reply=(`sed -n &#39;s/.*identifier=&quot;\(.*\)&quot;.*/\1/p&#39; \
kde_projects.xml`)<br>  reply=(${(ou)reply})<br>
<br>
If you want to go further, you can replace the sed with a while read :-)<br>
<span><font color="#888888"><br>
--<br>
Thiago Macieira - thiago (AT) <a href="http://macieira.info" \
target="_blank">macieira.info</a> - thiago (AT) <a href="http://kde.org" \
target="_blank">kde.org</a><br>  Software Architect - Intel Open Source Technology \
Center<br>  PGP/GPG: 0x6EF45358; fingerprint:<br>
         E067 918B B660 DBD1 105C   966C 33F5 F005 6EF4 5358<br>
</font></span></blockquote></div><br><br clear="all"><br></div></div><div \
class="im">-- <br>While you were hanging yourself on someone else&#39;s \
words<br>Dying to believe in what you heard<br>I was staring straight into the \
shining sun </div></div>
</blockquote></div><br><br clear="all"><br>-- <br>Cheerio,<br>Ivan<br><br>--<br>While \
you were hanging yourself on someone else&#39;s words<br>Dying to believe in what you \
heard<br>I was staring straight into the shining sun </div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic