ALT Linux Sisyphus discussions
 help / color / mirror / Atom feed
From: "Vadim V. Zhytnikov" <vvzhy@netorn.ru>
To: ALT Linux Sisyphus discussion list <sisyphus@lists.altlinux.org>
Subject: Re: [sisyphus] Помогите избавться от bashisma
Date: Sun, 03 Dec 2006 15:03:55 +0300
Message-ID: <4572BD2B.7060900@netorn.ru> (raw)
In-Reply-To: <20061203113820.GD54283@grep.po.cs.msu.su>

Fr. Br. George пишет:
> On Sat, Dec 02, 2006 at 12:16:38AM +0300, Vadim V. Zhytnikov wrote:
>> Есть простя задачка. Из набора *.texi файлов выделить те, которые
>> (1) содержат символы табуляции
>> (2) имеют строки с DOS-овскими окончаниями строк
>>
>> Для этого я использовал следующие команды
>>     bad_files1=`find . -name '*.texi' -print | xargs grep -l $'\t'`
>>     bad_files2=`find . -name '*.texi' -print | xargs grep -l $'\x0D$'`
>> Ну и собственно вопрос - чем можно заменить этот bashism,
>> чтобы сделать скрипт переноносимым?
> Да я просто заменил на соответствующие символы! В vim-е, например,
> вместо $'\t' можно написать '^V<Tab>', где ^V -- это ctrl+v, а <Tab> --
> это клавиша такая :). То же и $'\r$' -- '^V^M$'.
> 
Да, так тоже можно.  Просто не хотелось держать не-ASCII символы
в Makefile.am. Я уже потом сообразил, что этого можно избежать
поместив шаблоны поиска, т.е. ети самые ^V<Tab> и ^V^M, в отдельные
маленькие файлы и использовать grep с ключем -f.

-- 
      Vadim V. Zhytnikov

       <vvzhy@mail.ru>
      <vvzhy@netorn.ru>


      reply	other threads:[~2006-12-03 12:03 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-01 21:16 Vadim V. Zhytnikov
2006-12-02  6:10 ` Ildar Mulyukov
2006-12-02  7:14   ` Vadim V. Zhytnikov
2006-12-02  6:35 ` Вадим Илларионов
2006-12-02  7:09   ` Vadim V. Zhytnikov
2006-12-02 12:27     ` Yura Kalinichenko
2006-12-02 16:12       ` Vadim V. Zhytnikov
2006-12-03 11:38 ` Fr. Br. George
2006-12-03 12:03   ` Vadim V. Zhytnikov [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4572BD2B.7060900@netorn.ru \
    --to=vvzhy@netorn.ru \
    --cc=sisyphus@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Sisyphus discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/sisyphus/0 sisyphus/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 sisyphus sisyphus/ http://lore.altlinux.org/sisyphus \
		sisyphus@altlinux.ru sisyphus@altlinux.org sisyphus@lists.altlinux.org sisyphus@lists.altlinux.ru sisyphus@lists.altlinux.com sisyphus@linuxteam.iplabs.ru sisyphus@list.linux-os.ru
	public-inbox-index sisyphus

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


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