* [Comm] Имена файлов. @ 2004-04-14 3:31 Yevgeny Manyashev 2004-04-14 4:55 ` Andrey Brindeew 2004-04-14 6:45 ` BSW 0 siblings, 2 replies; 8+ messages in thread From: Yevgeny Manyashev @ 2004-04-14 3:31 UTC (permalink / raw) To: community Привет, All! Имеются zip-архивы, сделанные в винде, с русскими именами файлов. Вопрос: как перекодировать эти имена в koi8? Команда unzip -l 01.zip | iconv -f CP866 -t koi8 сразу же обламывается. -- Best regards Евгений ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Comm] Имена файлов. 2004-04-14 3:31 [Comm] Имена файлов Yevgeny Manyashev @ 2004-04-14 4:55 ` Andrey Brindeew 2004-04-14 5:22 ` Alexander Kuprin 2004-04-14 5:23 ` Maxim.Savrilov 2004-04-14 6:45 ` BSW 1 sibling, 2 replies; 8+ messages in thread From: Andrey Brindeew @ 2004-04-14 4:55 UTC (permalink / raw) To: community [-- Attachment #1: Type: text/plain, Size: 499 bytes --] On Wed, Apr 14, 2004 at 10:31:22AM +0700, Yevgeny Manyashev wrote: > Имеются zip-архивы, сделанные в винде, с русскими именами файлов. > > Вопрос: как перекодировать эти имена в koi8? > Команда > > unzip -l 01.zip | iconv -f CP866 -t koi8 > > сразу же обламывается. Почитай какую-нибудь детскую книжку по Юниксам. unzip у тебя пишет на диск, а iconv ждет от него данные на STDIN. -- WBR, Andrey Brindeew. "No one person can understand Perl culture completely" (C) Larry Wall. [-- Attachment #2: Type: application/pgp-signature, Size: 245 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Comm] Имена файлов. 2004-04-14 4:55 ` Andrey Brindeew @ 2004-04-14 5:22 ` Alexander Kuprin 2004-04-14 5:40 ` Re[2]: " Sergey A. Kolesnitchenko 2004-04-14 5:23 ` Maxim.Savrilov 1 sibling, 1 reply; 8+ messages in thread From: Alexander Kuprin @ 2004-04-14 5:22 UTC (permalink / raw) To: community On Wednesday 14 April 2004 07:55, Andrey Brindeew wrote: > On Wed, Apr 14, 2004 at 10:31:22AM +0700, Yevgeny Manyashev wrote: > > Имеются zip-архивы, сделанные в винде, с русскими именами файлов. > > Вопрос: как перекодировать эти имена в koi8? > > Команда > > unzip -l 01.zip | iconv -f CP866 -t koi8 > > > > сразу же обламывается. > > Почитай какую-нибудь детскую книжку по Юниксам. Например, вот эту http://www.linux.org.ru/books/LDP/lug.html Хотя ей уже 10 лет, но для общего ознакомления подойдёт. По крайней мере та часть, что относится не к "иксам". > unzip у тебя пишет на диск, а iconv ждет от него данные на STDIN. Но задачка интересная. Я попробовал её решить, использя find, но создать однострочник не вышло. :-\ Сперва я проверил такую конструкцию: find *.doc -exec echo '{}' | iconv -f cp866 -t koi8-r ';' Работает. Потом решил усложнить find *doc -exec mv -i '{}' `echo '{}' | iconv -f cp866 -t koi8-r` ';' Не заработало. Не выполняется подстановка нового имени файла из `echo '{}' | iconv -f cp866 -t koi8-r`. В конце концов написал маленький скрипт dos2koi: #!/bin/sh mv $1 `echo $1 | iconv -f cp866 -t koi8-r` который и вызывал при помощи find: find *doc -exec ./dos2koi '{}' ';' Так работает. Возможно я чего-то не знаю о find? Кто-нибудь может подсказать как подобную конструкцию реализовать одной строкой? -- WBR, Alexadner Kuprin ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re[2]: [Comm] Имена файлов. 2004-04-14 5:22 ` Alexander Kuprin @ 2004-04-14 5:40 ` Sergey A. Kolesnitchenko 0 siblings, 0 replies; 8+ messages in thread From: Sergey A. Kolesnitchenko @ 2004-04-14 5:40 UTC (permalink / raw) To: Alexander Kuprin AK> #!/bin/sh AK> mv $1 `echo $1 | iconv -f cp866 -t koi8-r` AK> который и вызывал при помощи find: AK> find *doc -exec ./dos2koi '{}' ';' AK> Так работает. Возможно я чего-то не знаю о find? Кто-нибудь может подсказать AK> как подобную конструкцию реализовать одной строкой? find -name '*.doc'|xargs что-вам-там-нужно-сделать След-но xargs --help -- Best regards, Sergey mailto:sergey.ak@mtu-net.ru ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Comm] Имена файлов. 2004-04-14 4:55 ` Andrey Brindeew 2004-04-14 5:22 ` Alexander Kuprin @ 2004-04-14 5:23 ` Maxim.Savrilov 2004-04-14 5:30 ` Alexander Kuprin 1 sibling, 1 reply; 8+ messages in thread From: Maxim.Savrilov @ 2004-04-14 5:23 UTC (permalink / raw) To: community [-- Attachment #1: Type: text/plain, Size: 801 bytes --] On Wed, 14 Apr 2004 08:55:57 +0400 Andrey Brindeew <abr@altlinux.ru> wrote: > On Wed, Apr 14, 2004 at 10:31:22AM +0700, Yevgeny Manyashev wrote: > > Имеются zip-архивы, сделанные в винде, с русскими именами файлов. > > > > Вопрос: как перекодировать эти имена в koi8? > > Команда > > > > unzip -l 01.zip | iconv -f CP866 -t koi8 > > > > сразу же обламывается. > > Почитай какую-нибудь детскую книжку по Юниксам. > unzip у тебя пишет на диск, а iconv ждет от него данные на STDIN. команда абсолютно корректна, так что совет по книжкам можете наклеить себе на монитор, Andrey Brindeew <abr@altlinux.ru> (гений, спаситель отечества и пр. и пр. и пр.) но нет диагностики с каким сообщением обламывается iconv? -- Некоторые пожилые граждане бывают опасны для нападающих. [-- Attachment #2: Type: application/pgp-signature, Size: 307 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Comm] Имена файлов. 2004-04-14 5:23 ` Maxim.Savrilov @ 2004-04-14 5:30 ` Alexander Kuprin 2004-04-14 5:49 ` Maxim.Savrilov 0 siblings, 1 reply; 8+ messages in thread From: Alexander Kuprin @ 2004-04-14 5:30 UTC (permalink / raw) To: community On Wednesday 14 April 2004 08:23, Maxim.Savrilov@socenter.ru wrote: > > > Имеются zip-архивы, сделанные в винде, с русскими именами файлов. > > > Вопрос: как перекодировать эти имена в koi8? > > > Команда > > > unzip -l 01.zip | iconv -f CP866 -t koi8 > > > сразу же обламывается. > команда абсолютно корректна, так что совет по книжкам можете наклеить себе > на монитор, Andrey Brindeew <abr@altlinux.ru> (гений, спаситель отечества и > пр. и пр. и пр.) > > но нет диагностики > с каким сообщением обламывается iconv? Максим, в отличие от Андрея Вы не правы. Возможно он высказал совет в немного резкой форме, но суть от этого не меняется. Евгению нужно подучиться, чтобы не задавать _такие_ вопросы. Единственный способ переименовать файлы в архиве (если только собственно архиватор не содержит подобный механизм), это распаковать архив, переименовать файлы, а потом запаковать. А ключ -l просто выводит список файлов и помочь тут никак не может. -- WBR, Alexander Kuprin ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Comm] Имена файлов. 2004-04-14 5:30 ` Alexander Kuprin @ 2004-04-14 5:49 ` Maxim.Savrilov 0 siblings, 0 replies; 8+ messages in thread From: Maxim.Savrilov @ 2004-04-14 5:49 UTC (permalink / raw) To: community [-- Attachment #1: Type: text/plain, Size: 1634 bytes --] On Wed, 14 Apr 2004 08:30:13 +0300 Alexander Kuprin <ru_classic@gts.lg.ua> wrote: > On Wednesday 14 April 2004 08:23, Maxim.Savrilov@socenter.ru wrote: > > > > Имеются zip-архивы, сделанные в винде, с русскими именами файлов. > > > > Вопрос: как перекодировать эти имена в koi8? > > > > Команда > > > > unzip -l 01.zip | iconv -f CP866 -t koi8 > > > > сразу же обламывается. > > команда абсолютно корректна, так что совет по книжкам можете наклеить себе > > на монитор, Andrey Brindeew <abr@altlinux.ru> (гений, спаситель отечества и > > пр. и пр. и пр.) > > > > но нет диагностики > > с каким сообщением обламывается iconv? > > Максим, в отличие от Андрея Вы не правы. Возможно он высказал совет в немного > резкой форме, но суть от этого не меняется. Евгению нужно подучиться, чтобы > не задавать _такие_ вопросы. Единственный способ переименовать файлы в архиве > (если только собственно архиватор не содержит подобный механизм), это > распаковать архив, переименовать файлы, а потом запаковать. А ключ -l просто > выводит список файлов и помочь тут никак не может. В вопросе не было указания на то, что нужно сделать новый архив с перекодированными именами человек привел корректную команду: >unzip -l 01.zip | iconv -f CP866 -t koi8 Исходя из этого, я решил что проблема в перекодировке, а не в переименовании ему в ответ: >unzip у тебя пишет на диск, а iconv ждет от него данные на STDIN. и совет про детские книжки. Хотя наверное неоднозначность вопроса и породила такие бурные реакции. Причем разные. Извиняюсь. -- Я ем все что дают. Что не дают - сперва отбираю, потом ем [-- Attachment #2: Type: application/pgp-signature, Size: 307 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [Comm] Имена файлов. 2004-04-14 3:31 [Comm] Имена файлов Yevgeny Manyashev 2004-04-14 4:55 ` Andrey Brindeew @ 2004-04-14 6:45 ` BSW 1 sibling, 0 replies; 8+ messages in thread From: BSW @ 2004-04-14 6:45 UTC (permalink / raw) To: community Yevgeny Manyashev wrote: > Привет, All! > > Имеются zip-архивы, сделанные в винде, с русскими именами файлов. > > Вопрос: как перекодировать эти имена в koi8? > Команда > > unzip -l 01.zip | iconv -f CP866 -t koi8 > > сразу же обламывается. ... сказав "iconv: conversion to koi8 unsupported"? Тогда возможно 'iconv -f cp866 -t koi8-r' спасет отца русской демократии. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2004-04-14 6:45 UTC | newest] Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2004-04-14 3:31 [Comm] Имена файлов Yevgeny Manyashev 2004-04-14 4:55 ` Andrey Brindeew 2004-04-14 5:22 ` Alexander Kuprin 2004-04-14 5:40 ` Re[2]: " Sergey A. Kolesnitchenko 2004-04-14 5:23 ` Maxim.Savrilov 2004-04-14 5:30 ` Alexander Kuprin 2004-04-14 5:49 ` Maxim.Savrilov 2004-04-14 6:45 ` BSW
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