* [Comm] grep syntax question
@ 2004-03-20 15:35 Sergey Kuznetsov
2004-03-20 15:36 ` Denis S. Filimonov
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Sergey Kuznetsov @ 2004-03-20 15:35 UTC (permalink / raw)
To: ALT
Здравствуйте!
Для того, чтобы вывести на экран все закомментированные строчки
какого-либо файла настройки достаточно сказать:
cat <some file> | grep ^#
А что надо сказать, чтобы увидеть НЕзакомментированные строчки?
cat <some file> | grep !^# равоно как и cat <some file> | grep ^!#
не прокатывает.
С уважением,
Сергей
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Comm] grep syntax question
2004-03-20 15:35 [Comm] grep syntax question Sergey Kuznetsov
@ 2004-03-20 15:36 ` Denis S. Filimonov
2004-03-20 15:40 ` Sergey Kuznetsov
2004-03-23 11:23 ` tarasenko
2004-03-23 11:26 ` tarasenko
2 siblings, 1 reply; 6+ messages in thread
From: Denis S. Filimonov @ 2004-03-20 15:36 UTC (permalink / raw)
To: community
On Saturday 20 March 2004 21:35, Sergey Kuznetsov wrote:
> Здравствуйте!
>
> Для того, чтобы вывести на экран все закомментированные строчки
> какого-либо файла настройки достаточно сказать:
>
> cat <some file> | grep ^#
grep -v ^#
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Comm] grep syntax question
2004-03-20 15:35 [Comm] grep syntax question Sergey Kuznetsov
2004-03-20 15:36 ` Denis S. Filimonov
@ 2004-03-23 11:23 ` tarasenko
2004-03-23 18:29 ` Sergey Kuznetsov
2004-03-23 11:26 ` tarasenko
2 siblings, 1 reply; 6+ messages in thread
From: tarasenko @ 2004-03-23 11:23 UTC (permalink / raw)
To: Sergey Kuznetsov
Здравствуйте, Sergey,
Saturday, March 20, 2004, 5:35:15 PM, вы писали:
SK> Здравствуйте!
SK> Для того, чтобы вывести на экран все закомментированные строчки
SK> какого-либо файла настройки достаточно сказать:
SK> cat <some file> | grep ^#
SK> А что надо сказать, чтобы увидеть НЕзакомментированные строчки?
SK> cat <some file> | grep !^# равоно как и cat <some file> | grep ^!#
SK> не прокатывает.
Попробуй
cat <file> | grep ^[^#]
--
С уважением,
tarasenko mailto:tarasenko@newlogic.com.ua
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Comm] grep syntax question
2004-03-23 11:23 ` tarasenko
@ 2004-03-23 18:29 ` Sergey Kuznetsov
0 siblings, 0 replies; 6+ messages in thread
From: Sergey Kuznetsov @ 2004-03-23 18:29 UTC (permalink / raw)
To: community
On Tue, 23 Mar 2004 13:23:48 +0200
tarasenko <tarasenko@newlogic.com.ua> wrote:
> SK> Здравствуйте!
>
> SK> Для того, чтобы вывести на экран все закомментированные
> SK> строчки какого-либо файла настройки достаточно сказать:
>
> SK> cat <some file> | grep ^#
>
> SK> А что надо сказать, чтобы увидеть НЕзакомментированные
> SK> строчки? cat <some file> | grep !^# равоно как и cat <some
> SK> file> | grep ^!# не прокатывает.
>
> Попробуй
>
> cat <file> | grep ^[^#]
Такой вариант тоже работает (хотя вариант Дениса Филимонова
[с ключом -v] изящнее)...
> grep <file> '^[^#]'
^^^^^^^^^^^^^^^^^^^
...а вот этот не пашет:
[yozhik@localhost yozhik]$ grep /etc/X11/XF86Config-4 '^[^#]'
grep: ^[^#]: No such file or directory
С уважением,
Сергей
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [Comm] grep syntax question
2004-03-20 15:35 [Comm] grep syntax question Sergey Kuznetsov
2004-03-20 15:36 ` Denis S. Filimonov
2004-03-23 11:23 ` tarasenko
@ 2004-03-23 11:26 ` tarasenko
2 siblings, 0 replies; 6+ messages in thread
From: tarasenko @ 2004-03-23 11:26 UTC (permalink / raw)
To: Sergey Kuznetsov
Здравствуйте, Sergey,
Saturday, March 20, 2004, 5:35:15 PM, вы писали:
SK> Здравствуйте!
SK> Для того, чтобы вывести на экран все закомментированные строчки
SK> какого-либо файла настройки достаточно сказать:
SK> cat <some file> | grep ^#
SK> А что надо сказать, чтобы увидеть НЕзакомментированные строчки?
SK> cat <some file> | grep !^# равоно как и cat <some file> | grep ^!#
SK> не прокатывает.
grep <file> '^[^#]'
--
С уважением,
tarasenko mailto:tarasenko@newlogic.com.ua
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2004-03-23 18:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-20 15:35 [Comm] grep syntax question Sergey Kuznetsov
2004-03-20 15:36 ` Denis S. Filimonov
2004-03-20 15:40 ` Sergey Kuznetsov
2004-03-23 11:23 ` tarasenko
2004-03-23 18:29 ` Sergey Kuznetsov
2004-03-23 11:26 ` tarasenko
ALT Linux Community general discussions
This inbox may be cloned and mirrored by anyone:
git clone --mirror http://lore.altlinux.org/community/0 community/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 community community/ http://lore.altlinux.org/community \
mandrake-russian@linuxteam.iplabs.ru community@lists.altlinux.org community@lists.altlinux.ru community@lists.altlinux.com
public-inbox-index community
Example config snippet for mirrors.
Newsgroup available over NNTP:
nntp://lore.altlinux.org/org.altlinux.lists.community
AGPL code for this site: git clone https://public-inbox.org/public-inbox.git