ALT Linux Team development discussions
 help / color / mirror / Atom feed
* Re: [devel] [git update] packages/kernel-build-scripts: heads/master
  @ 2008-04-19 17:41 ` Slava Semushin
  2008-04-19 19:20   ` Денис Смирнов
  0 siblings, 1 reply; 3+ messages in thread
From: Slava Semushin @ 2008-04-19 17:41 UTC (permalink / raw)
  To: ALT Devel discussion list

2008/4/19, Denis Smirnov <mithraen / altlinux.org>:
> Update of /people/mithraen/packages/kernel-build-scripts.git
[...]
>  +++ b/list-ovz-modules
>
> @@ -0,0 +1,9 @@
>  +#!/bin/sh
>
> +apt-cache search "^kernel-modules-.*-ovz-smp" \
>  +       | sed 's/ - .*//' \
>  +       | sed 's/^kernel-modules-//' \
>  +       | sed 's/-ovz-smp$//' \
>  +       | grep -v ^oss$ \
>  +       | sort -u \
>  +       > kernel-modules
>  +

Можно чуть короче:

apt-cache search '^kernel-modules-.*-ovz-smp' |
    sed 's|^kernel-modules-\([^ ]\+\)-ovz-smp - .*|\1|;/^oss$/d' |
    sort -u > kernel-modules

:-)

-- 
+ Slava Semushin | slava.semushin @ gmail.com
+ ALT Linux Team | php-coder @ altlinux.ru

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [devel] [git update] packages/kernel-build-scripts: heads/master
  2008-04-19 17:41 ` [devel] [git update] packages/kernel-build-scripts: heads/master Slava Semushin
@ 2008-04-19 19:20   ` Денис Смирнов
  2008-04-21 14:36     ` Michael Shigorin
  0 siblings, 1 reply; 3+ messages in thread
From: Денис Смирнов @ 2008-04-19 19:20 UTC (permalink / raw)
  To: ALT Linux Team development discussions

[-- Attachment #1: Type: text/plain, Size: 821 bytes --]

On Sun, Apr 20, 2008 at 12:41:49AM +0700, Slava Semushin wrote:
>> +apt-cache search "^kernel-modules-.*-ovz-smp" \
>>  +       | sed 's/ - .*//' \
>>  +       | sed 's/^kernel-modules-//' \
>>  +       | sed 's/-ovz-smp$//' \
>>  +       | grep -v ^oss$ \
>>  +       | sort -u \
>>  +       > kernel-modules
>>  +
 SS> Можно чуть короче:
 SS> apt-cache search '^kernel-modules-.*-ovz-smp' |
 SS>     sed 's|^kernel-modules-\([^ ]\+\)-ovz-smp - .*|\1|;/^oss$/d' |
 SS>     sort -u > kernel-modules
SS> :-)

Оптимальнее, но читается и редактируется хуже. Для скриптика который
отрабатывает быстр и запускается раз в несколько недель -- лучше
оптимизировать читабельность :)
-- 
С уважением, Денис

http://freesource.info
----------------------------------------------------------------------------

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [devel] [git update] packages/kernel-build-scripts: heads/master
  2008-04-19 19:20   ` Денис Смирнов
@ 2008-04-21 14:36     ` Michael Shigorin
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Shigorin @ 2008-04-21 14:36 UTC (permalink / raw)
  To: ALT Linux Team development discussions

On Sat, Apr 19, 2008 at 11:20:38PM +0400, Денис Смирнов wrote:
> >>  +       | sed 's/ - .*//' \
> >>  +       | sed 's/^kernel-modules-//' \
> >>  +       | sed 's/-ovz-smp$//' \
>  SS>     sed 's|^kernel-modules-\([^ ]\+\)-ovz-smp - .*|\1|;/^oss$/d' |
> Оптимальнее, но читается и редактируется хуже.

В таких случаях порой делаю подобным образом:

| sed -e 's/ - .*//' \
      -e 's/^kernel-modules-//' \
      -e 's/-ovz-smp$//' \

-- 
 ---- WBR, Michael Shigorin <mike@altlinux.ru>
  ------ Linux.Kiev http://www.linux.kiev.ua/


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-04-21 14:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-04-19 17:41 ` [devel] [git update] packages/kernel-build-scripts: heads/master Slava Semushin
2008-04-19 19:20   ` Денис Смирнов
2008-04-21 14:36     ` Michael Shigorin

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git