Gentoo Archives: gentoo-user-ru

From: Victor Skurihin <stalker@××.ru>
To: gentoo-user-ru@l.g.o
Subject: [gentoo-user-ru] В текущем каталоге и его подкаталогах, во всех файлах в именах которых содержется пробел/пробелы заменить их на знак "_".
Date: Fri, 02 Jun 2006 17:44:56
Message-Id: 448078E4.10305@nc.ru
1 Доброго времени суток, многоуважемые.
2
3 Вот для решения сабжа попробовал использовать find,
4 find ./ -type f -regex ".* .*" -exec mv {} `echo {}|tr ' ' '_'` \;
5 но не добился желаемого:
6
7 stalker@ux /tmp/testdir $ ls -1
8 1 test file.txt
9 2 test file.txt
10 3 test file.txt
11 stalker@ux /tmp/testdir $ find ./ -type f -regex ".* .*" -exec mv {} `echo {}|tr ' ' '_'` \;
12 mv: `./2 test file.txt' and `./2 test file.txt' are the same file
13 mv: `./3 test file.txt' and `./3 test file.txt' are the same file
14 mv: `./1 test file.txt' and `./1 test file.txt' are the same file
15
16 Подскажите пожалуйста где ошибся?
17 --
18 Victor Skurihin
19 Jabber: stalker@××××××××××.ru
20
21
22
23
24
25 --
26 gentoo-user-ru@g.o mailing list

Replies