ALT Linux Community general discussions
 help / color / mirror / Atom feed
* [Comm] kmail & script
@ 2005-12-08 17:49 anyr
  2005-12-18 10:59 ` anyr
  0 siblings, 1 reply; 3+ messages in thread
From: anyr @ 2005-12-08 17:49 UTC (permalink / raw)
  To: ALTLinux Community

В рассылке community иногда приходят письма с Subject: 
[Comm] =?iso-8859-1, у меня в kmail такие заголовки криво 
отображаются. Хотел сделать как лучше.

Сделал дополнительный фильр на все входящие письма который 
пропускает их через конвеер - скрипт. Ничего не выходит.

Вот текст скрипта:
#!/bin/bash
IFS=;
while read line;  do
  if [[ "$line" == Subject:* ]]; then
      echo "$line" | iconv -f ISO8859-1 -t KOI8-R
    else
      echo "$line"
  fi
done

Что не так?

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

* Re: [Comm] kmail & script
  2005-12-08 17:49 [Comm] kmail & script anyr
@ 2005-12-18 10:59 ` anyr
  2005-12-18 15:43   ` Damir Shayhutdinov
  0 siblings, 1 reply; 3+ messages in thread
From: anyr @ 2005-12-18 10:59 UTC (permalink / raw)
  To: ALT Linux Community

Ну скажите, скрипт хоть правильно нарисован?

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

* Re: [Comm] kmail & script
  2005-12-18 10:59 ` anyr
@ 2005-12-18 15:43   ` Damir Shayhutdinov
  0 siblings, 0 replies; 3+ messages in thread
From: Damir Shayhutdinov @ 2005-12-18 15:43 UTC (permalink / raw)
  To: anyr, ALT Linux Community

18.12.05, anyr<anyr@tut.by> написал(а):
> Ну скажите, скрипт хоть правильно нарисован?
Неправильно.
Проверка
 if [[ "$line" == Subject:* ]]; then
неверна.

Используйте grep и регулярные выражения. Ну или case
например
case "$line" in
       Subject:*)
               echo "$line" | iconv -f ISO8859-1 -t koi8-r
               ;;
       *)
               echo "$line"
               ;;
esac

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

end of thread, other threads:[~2005-12-18 15:43 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-12-08 17:49 [Comm] kmail & script anyr
2005-12-18 10:59 ` anyr
2005-12-18 15:43   ` Damir Shayhutdinov

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