rename appears useless in Ubuntu
Heike C. Zimmerer
nospam08q2 at gmx.net
Wed May 13 16:31:43 UTC 2009
anthony baldwin <photodharma at gmail.com> writes:
> Heike C. Zimmerer wrote:
> Ah, but it DOES work, young paduan.
I never wrote something different. Thanks.
> A working version would be
>>
>> for i in *."$a"
>>
>> Now:
>>
>>> do
>>> rename \ _ *.$a
>>
>> With the for clause adjusted as depicted above, use
>>
>> mv "$i" "${i// /_}"
>>
>> here, and you should be done (not tested). As you wrote it, the rename
>> command is called many times with the first call doing the real work and
>> getting all the file names as arguments (*.$a), and the remaining calls
>> being useless (but doing no harm) since there a no spaces in file names
>> any more.
>
> The first time, it removes the first space in each file name,
> then the second, etc.
> If I run it without the loop, it only removes the first space.
So the number of files must be equal or greater the maximum number of
spaces in a filename ... that's not exactly reliable ...
I didn't want to offend you. It's just what can be easily seen if one
looks at your script. If you think it's fine as it is, forget what I
wrote and continue.
Heike
More information about the ubuntu-users
mailing list