ALT Linux Community general discussions
 help / color / mirror / Atom feed
From: Vitaly Ostanin <vyt@vzljot.ru>
To: community@altlinux.ru
Subject: [Comm] Re: growisofs (was: Bash string for escape symbols in string)
Date: Mon, 21 Feb 2005 16:32:14 +0300
Message-ID: <4219E2DE.90801@vzljot.ru> (raw)
In-Reply-To: <4219D236.8070800@vzljot.ru>

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

Vitaly Ostanin пишет:
> Dmitry V. Levin пишет:
>
>>Hi,
>>
>>On Mon, Feb 21, 2005 at 02:30:48PM +0300, Vitaly Ostanin wrote:
>>
>>
>>>Подскажите, pls, чем из coreutils из функций bash можно
>>>экранировать спец. символы в строке?
>>
>>Условие "из coreutils" обязательно?
>
> Нет, это я пытался по-умному выразить доступность и
> распространённость инструмента :)
>
>>А то я бы выбрал sed.
>
> Спасибо, попробую.

Попробовал - не получилось, и это утешает - неужели может быть
разница в способах экранирования? Скажите, у кого из нас ошибка в
ДНК - у меня или у growisofs ?

$ cat burn-dvd-files.sh

GRAFT_OPT=
for i in "$@"
do
     if [ "$GRAFT_OPT"x != x ]; then GRAFT_OPT=$GRAFT_OPT\ ; fi
     GRAFT_OPT=$GRAFT_OPT\"/$i\"=\"$i\"
done
#echo $GRAFT_OPT
growisofs -Z /dev/cdrecorder -R -jcharset cp1251 -graft-points
$GRAFT_OPT

$ ./burn-dvd-files.sh Тестовый\ каталог/ Снова\ тестовый\ каталог/
WARNING: /dev/cdrecorder already carries isofs!
About to execute 'mkisofs -R -jcharset cp1251 -graft-points
"/Тестовый каталог/"="Тестовый каталог/" "/Снова тестовый
каталог/"="Снова тестовый каталог/" | builtin_dd
of=/dev/cdrecorder obs=32k seek=0'
mkisofs: No such file or directory. Invalid node - "/Тестовый
:-( write failed: Input/output error

После убирания кавычек из цикла (\"):

$ ./burn-dvd-files.sh Тестовый\ каталог/ Снова\ тестовый\ каталог/
WARNING: /dev/cdrecorder already carries isofs!
About to execute 'mkisofs -R -jcharset cp1251 -graft-points
/Тестовый каталог/=Тестовый каталог/ /Снова тестовый
каталог/=Снова тестовый каталог/ | builtin_dd of=/dev/cdrecorder
obs=32k seek=0'
mkisofs: No such file or directory. Invalid node - /Тестовый
:-( write failed: Input/output error

После добавления кавычек в запуск growisofs:

growisofs -Z /dev/cdrecorder -R -jcharset cp1251 -graft-points
"$GRAFT_OPT"

$ ./burn-dvd-files.sh Тестовый\ каталог/ Снова\ тестовый\ каталог/
WARNING: /dev/cdrecorder already carries isofs!
About to execute 'mkisofs -R -jcharset cp1251 -graft-points
/Тестовый каталог/=Тестовый каталог/ /Снова тестовый
каталог/=Снова тестовый каталог/ | builtin_dd of=/dev/cdrecorder
obs=32k seek=0'
mkisofs: No such file or directory. Invalid node - Тестовый
каталог/ /Снова тестовый каталог/=Снова тестовый каталог/
:-( write failed: Input/output error

При этом скрипт такого содержания пишет нормально:

growisofs -Z /dev/cdrecorder -R -jcharset cp1251 -graft-points
"/Тестовый каталог=Тестовый каталог" "/Снова тестовый
каталог=Снова тестовый каталог"


--
Regards, Vyt
mailto:  vyt@vzljot.ru
JID:     vyt@vzljot.ru

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 256 bytes --]

  reply	other threads:[~2005-02-21 13:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-02-21 11:30 [Comm] Bash string for escape symbols in string Vitaly Ostanin
2005-02-21 12:14 ` Dmitry V. Levin
2005-02-21 12:21   ` [Comm] " Vitaly Ostanin
2005-02-21 13:32     ` Vitaly Ostanin [this message]
2005-02-21 22:28       ` [Comm] quotation in shell Dmitry V. Levin

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=4219E2DE.90801@vzljot.ru \
    --to=vyt@vzljot.ru \
    --cc=community@altlinux.ru \
    /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 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