Re: The rename command…



2008/8/26 Johnny Rosenberg <gurus.knugum@xxxxxxxxx>

2008/8/25 Ulf Rompe <Ulf.Rompe@xxxxxxxx>

Sorry all for the previous, empty post.

On Mo, 2008-08-25 at 16:00 +0200, Johnny Rosenberg wrote:
Since there is a serious bug in Nautilus, that adds the very
unnecessary text "Link to " to a link created with Ctrl+Shift
+Drag&Drop,

I don't think it's a serious bug. I would call it bad design. :-)

rename -v 's/Link to //' *

However, there doesn't seem to be an option for recursivity built in
to that command. I am not good with scripts, but I am sure there is a
way around that.

find . -type l -print0 | xargs -0 rename -v 's/Link to //'

[x] ulf

Tack så mycket! Har inte testat än, men det ser ut som en vettigare
lösning än den jag lyckades komma fram till via vild sökning på nätet:
find . -name "Länk till "* -exec rename -v "s/Länk till //" {} \;
My guess is that your solution might be a bit faster. IN my solution, both
find and rename look for the same thing, kind of…
As everyone can see, I'm a bash beginner but I learn all the time. I think
that my new knowledge of xargs will make me able to do things that I
couldn't before! Thanks again!
J.R.

Ooops, sorry for the Swedish line there. For a strange reason I changed to
English after that, I don't really know why… here's the translation for the
first line anyway:

Thanks! haven't tried it yet, but it makes more sense than the solution I
came up with after some wild searching on the web:

find… and so on.

By the way, after some more thinking, I combined your solution with mine and
came up with the following:

find . -type l -exec rename -v "s/Länk till //" {} \;

This way it's all done without piping, at least that is what it looks like.
It would be interesting to hear from you (and others) about advantages and
disadvantages with this line compared to other ideas. The only advantage I
can think of is that it's less to type, but I will make an alias for it
anyway, so that doesn't matter much, more than my alias file will be a few
bytes smaller…

Anf I didn't try my last suggestion yet, maybe it doesn't work… ha ha ha

J.R.
--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users


Relevant Pages

  • Re: OT: Exchange (Was Re: OpenVMS - When downtime is not an option)
    ... application bug to provide access to protected data and/or provides ... the bugs *only* affected Exchange Server. ... Server* design flaw, not a Windows flaw. ... Microsoft product and those same designers and programmers have probably ...
    (comp.os.vms)
  • Re: pppd crashes, was: kde-freebsd
    ... User PPP is very easy to use, Kernel PPP is not. ... It appears to me that PPP is the more normal way on FreeBSD, whereas, in my own experience Linux, prefer PPPD. ... Over time FreeBSD and Linux drifted apart on this design issue, and it became something of a characteristic of BSD, perhaps that is why Kernel PPP became less well maintained ... Regarding the various comments by Michael Nottebrock, Firstly: The bug you mentioned I have not experienced. ...
    (freebsd-stable)
  • Re: Off switch blues
    ... it's not a feature it's a bug. ... like, consider a design bug. ... sleep, close the lid, and unplug the keyboard, it's because I intend to ... I don't intend for it to wake back up until I open the ...
    (comp.sys.mac.system)
  • Re: What Happened to Grundig?
    ... improve the original Sony design. ... Regarding how Grundig came to use the Sony design, ... Correcting the bug only realizes what the design ...
    (rec.radio.shortwave)
  • Re: c / c++ : is it end of era ?
    ... That's not a bug. ... It's a design decision. ... If you want a super-handholding, ultra-safe language, they are out ... hence he is not a C programmer. ...
    (comp.lang.c)