ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] Помогите с bash & awk & sed
@ 2003-11-30 16:38 Igor
  2003-11-30 17:31 ` Taras Ablamsky
  0 siblings, 1 reply; 2+ messages in thread
From: Igor @ 2003-11-30 16:38 UTC (permalink / raw)
  To: community

Подскажите как из таких строк в bash вытащить  email?
Строки могут быть такие:
To: asdasdw@xxx.ru
To: <iqwdegrgo@xxx.ru>
домен один и тот же.
Делаю 
cat file|grep "^To:" | а дальше ...





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

* Re: [Comm] Помогите с bash & awk & sed
  2003-11-30 16:38 [Comm] Помогите с bash & awk & sed Igor
@ 2003-11-30 17:31 ` Taras Ablamsky
  0 siblings, 0 replies; 2+ messages in thread
From: Taras Ablamsky @ 2003-11-30 17:31 UTC (permalink / raw)
  To: community



Igor пишет:
> Подскажите как из таких строк в bash вытащить  email?
> Строки могут быть такие:
> To: asdasdw@xxx.ru
> To: <iqwdegrgo@xxx.ru>
> домен один и тот же.
> Делаю cat file|grep "^To:" | а дальше ...
> 
Первое что пришло в голову:

cat file|grep ^To:|sed "s/@.*$//"|sed "s/^To: \?<\?//"|sed "s/$/@xxx.ru/"

Можно, конечно, еще подумать и оптимизировать.

--
Taras Ablamsky



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

end of thread, other threads:[~2003-11-30 17:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-30 16:38 [Comm] Помогите с bash & awk & sed Igor
2003-11-30 17:31 ` Taras Ablamsky

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