Re: The rename command…
- From: Ulf Rompe <Ulf.Rompe@xxxxxxxx>
- Date: Wed, 27 Aug 2008 17:44:19 +0200
On Mi, 2008-08-27 at 00:00 +0200, Johnny Rosenberg wrote:
When I was searching for a solution to my problem (which I now
consider solved) I think I ran into a solution without the rename
command… I think they used mv instead, but I can't find it.
You may well do it with mv instead of rename:
find . -name "Link to *" | while read name; do mv "$name" "`echo $name | sed -e "s/Link to //"`"; done
Is there a reason not to use rename (such as it might be slow or
something, maybe even incompatibility with non-Debian based systems)?
None that I know of. There are just many ways to solve your problem. If
you are worried about portability, it may be worth to skip perl and use
the standard UNIX toolkit. The above needs a plain Bourne shell, mv and
sed. It should therefore even work on workstations from the 1980s. So,
if you ever happen to have the Nautilus problem on one of those, ... ;-)
I realise that I need regular expressions to achieve the name change,
which makes rename the convenient choice, but there should be other
ways, shouldn't it?
Of course. Another way involving regular expressions could be mmv which
is available in universe.
[x] ulf
--
Real programmers confuse Christmas and Halloween because
DEC 25 = OCT 31!
--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
- Follow-Ups:
- Re: The rename command…
- From: Ulf Rompe
- Re: The rename command…
- References:
- The rename command…
- From: Johnny Rosenberg
- Re: The rename command…
- From: Ulf Rompe
- Re: The rename command…
- From: Johnny Rosenberg
- Re: The rename command…
- From: Johnny Rosenberg
- Re: The rename command…
- From: Rashkae
- Re: The rename command…
- From: Johnny Rosenberg
- Re: The rename command…
- From: Johnny Rosenberg
- The rename command…
- Prev by Date: Rutebook
- Next by Date: Re: Rutebook
- Previous by thread: Re: The rename command…
- Next by thread: Re: The rename command…
- Index(es):