From kde-core-devel Sat Jan 11 16:04:13 2014 From: Thiago Macieira Date: Sat, 11 Jan 2014 16:04:13 +0000 To: kde-core-devel Subject: Re: ZSH completion for kdesrc-build Message-Id: <1730380.eEWOWl8tMO () tjmaciei-mobl2> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=138945629202071 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--nextPart2298755.2FIL9EpLyx" --nextPart2298755.2FIL9EpLyx Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" On s=C3=A1bado, 11 de janeiro de 2014 11:38:25, Ivan =C4=8Cuki=C4=87 wr= ote: > function _ksrccomp() { > reply=3D(`grep identifier kde_projects.xml | sed 's/^[^"]*"//' | se= d > 's/".*//' | sort -u`) > } Replace the grep and two sed with just one sed: reply=3D(`sed -n 's/.*identifier=3D"\(.*\)".*/\1/p' kde_projects.xml= | sort -u`) You can also use zsh expansion modifiers "o" and "u" to sort and uniqui= fy: reply=3D(`sed -n 's/.*identifier=3D"\(.*\)".*/\1/p' kde_projects.xm= l`) reply=3D(${(ou)reply}) If you want to go further, you can replace the sed with a while read :-= ) --=20 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 --nextPart2298755.2FIL9EpLyx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part. Content-Transfer-Encoding: 7Bit -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (GNU/Linux) iD8DBQBS0WuHM/XwBW70U1gRAmPdAJ0R+EeJMqhw/TD86s3vtmnkPc4HJQCfd3TQ 1hsok5OgwH9kfqz2unN2MgA= =IhxQ -----END PGP SIGNATURE----- --nextPart2298755.2FIL9EpLyx--