summaryrefslogtreecommitdiffstats
path: root/zarb-ml/mageia-discuss/2013-January/009033.html
blob: bd44c2141ffa368f5b7d1534884e20ad515d292f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
 <HEAD>
   <TITLE> [Mageia-discuss] Debian-style &#171;rename&#187; utility?
   </TITLE>
   <LINK REL="Index" HREF="index.html" >
   <LINK REL="made" HREF="mailto:mageia-discuss%40mageia.org?Subject=Re%3A%20%5BMageia-discuss%5D%20%3D%3Fiso-8859-1%3Fq%3FDebian-style_%3DABrename%3DBB_utility%3F%3D%0A%09%3D%3Fiso-8859-1%3Fq%3F%3D3F%3F%3D&In-Reply-To=%3C201301012158.16519.cooker%40solbu.net%3E">
   <META NAME="robots" CONTENT="index,nofollow">
   <META http-equiv="Content-Type" content="text/html; charset=us-ascii">
   
   <LINK REL="Next"  HREF="009034.html">
 </HEAD>
 <BODY BGCOLOR="#ffffff">
   <H1>[Mageia-discuss] Debian-style &#171;rename&#187; utility?</H1>
    <B>Johnny A. Solbu</B> 
    <A HREF="mailto:mageia-discuss%40mageia.org?Subject=Re%3A%20%5BMageia-discuss%5D%20%3D%3Fiso-8859-1%3Fq%3FDebian-style_%3DABrename%3DBB_utility%3F%3D%0A%09%3D%3Fiso-8859-1%3Fq%3F%3D3F%3F%3D&In-Reply-To=%3C201301012158.16519.cooker%40solbu.net%3E"
       TITLE="[Mageia-discuss] Debian-style &#171;rename&#187; utility?">cooker at solbu.net
       </A><BR>
    <I>Tue Jan  1 21:58:12 CET 2013</I>
    <P><UL>
        
        <LI>Next message: <A HREF="009034.html">[Mageia-discuss] Debian-style &#171;rename&#187; utility?
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#9033">[ date ]</a>
              <a href="thread.html#9033">[ thread ]</a>
              <a href="subject.html#9033">[ subject ]</a>
              <a href="author.html#9033">[ author ]</a>
         </LI>
       </UL>
    <HR>  
<!--beginarticle-->
<PRE>Sometimes I need to mass rename filenames, to replace norwegian special caracters, to make things work across samba.
On Debian th rename utility user &#171;sed&#187; style replacements, which means one command can replace all instances of a character or string recursively in all subfolders. But on Mandriva and Mageia, I have to run the exact same command multiple times in the same folder to do the same thing. And I can't do it recursively.

One example. Say I want to recursively replace all spaces ' ' with an underscore '_' on all files in every subfolder under &#171;folder2&#187;

On Debian: 
	replace 's/\ /_/g' folder2/

On Mageia:
	cd folder2
	replace ' ' '_' *
	replace ' ' '_' *
	replace ' ' '_' *
	replace ' ' '_' *

	cd subfolder1
	replace ' ' '_' *
	&lt;repeating&gt;
	&lt;repeating&gt;
	......
and so on.

Is there a command line utility on Mageia that can do this te way Debian does this, without resorting to creating a shellscript each time I need to replace something? (I'm no good at scripting, so I've had to do this manually for some 11 years.)

-- 
Johnny A. Solbu
PGP key ID: 0xFA687324
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: &lt;/pipermail/mageia-discuss/attachments/20130101/352086aa/attachment.asc&gt;
</PRE>


<!--endarticle-->
    <HR>
    <P><UL>
        <!--threads-->
	
	<LI>Next message: <A HREF="009034.html">[Mageia-discuss] Debian-style &#171;rename&#187; utility?
</A></li>
         <LI> <B>Messages sorted by:</B> 
              <a href="date.html#9033">[ date ]</a>
              <a href="thread.html#9033">[ thread ]</a>
              <a href="subject.html#9033">[ subject ]</a>
              <a href="author.html#9033">[ author ]</a>
         </LI>
       </UL>

<hr>
<a href="https://www.mageia.org/mailman/listinfo/mageia-discuss">More information about the Mageia-discuss
mailing list</a><br>
</body></html>