Re: [gentoo-user] [OT] Filename modification with suffix

2005-12-31 Thread Neil Bothwick
On Sat, 31 Dec 2005 20:38:32 +0100, Matthias Bethke wrote: > | $ ls *.jpg | while read f; do echo "$f"; done > | foo bar.jpg > The quotes are useless for "echo" here, but for other commands you'll > usually need them to keep the command form taking filenames with sapaces > as separate arguments.

Re: [gentoo-user] [OT] Filename modification with suffix

2005-12-31 Thread Matthias Bethke
Hi David, on Thursday, 2005-12-29 at 13:53:17, you wrote: > > $(ls *.jpg) > > ick! > > (incidentally, http://www.ruhr.de/home/smallo/award.html#ls) Well, it's bad in two ways, and even the example on the above webpage is wrong. For one thing, "ls" is useless here. For another, it will break on s

Re: [gentoo-user] [OT] Filename modification with suffix

2005-12-29 Thread Lithion
Such a question shows the power of bash programming. Method1 : ls -1 *.jpg | while read file; do mv "$file" \ "donald_$file"; done Method2 : ls -1 *.jpg | awk '{ print "mv "$1" donald_"$1; } | \ /bin/bash Method3 : find -name "*.jpg" -exec mv {} donald_{} ';' On Fri, 30 Dec 2005 11:57 am,

Re: [gentoo-user] [OT] Filename modification with suffix

2005-12-29 Thread Jerry McBride
On Thursday 29 December 2005 08:24, Marco Calviani wrote: > Hi list, >maybe this question is a little bit related since it regards non > Gentoo-specific topics. > I would like to add a specific suffix to a list of files. For example > i have files of the type: > > duck1.jpg > duck2.jpg > duck3.

Re: [gentoo-user] [OT] Filename modification with suffix

2005-12-29 Thread Marco Calviani
2005/12/29, David Morgan <[EMAIL PROTECTED]>: > > for i in duck*.jpg ; do mv ${i} donald_${i} ; done Well! Thank you very much David. That solved my problem! Best regards, MC -- gentoo-user@gentoo.org mailing list

Re: [gentoo-user] [OT] Filename modification with suffix

2005-12-29 Thread Christoph Eckert
> > $(ls *.jpg) > > ick! > > (incidentally, http://www.ruhr.de/home/smallo/award.html#ls) I forgot to clarify that the CPU of my notebook usually is bored and waits until I move my mouse, so some ls processes can make it a bit busy :) . Best regards ce -- gentoo-user@gentoo.org mailing lis

Re: [gentoo-user] [OT] Filename modification with suffix

2005-12-29 Thread Ciaran McCreesh
On Thu, 29 Dec 2005 14:24:31 +0100 Marco Calviani <[EMAIL PROTECTED]> wrote: | duck1.jpg | duck2.jpg | duck3.jpg | | and i would like them to become: | | donald_duck1.jpg | donald_duck2.jpg | donald_duck3.jpg | | Does somebody knows a simple way to do this via shell? rename '' 'donald_' duck*.j

Re: [gentoo-user] [OT] Filename modification with suffix

2005-12-29 Thread Christoph Eckert
> i have files of the type: > > duck1.jpg > duck2.jpg > duck3.jpg > > and i would like them to become: > > donald_duck1.jpg > donald_duck2.jpg > donald_duck3.jpg > > Does somebody knows a simple way to do this via shell? for i in $(ls *.jpg); do mv $i donald_$i; done Best regards ce -- gento

Re: [gentoo-user] [OT] Filename modification with suffix

2005-12-29 Thread David Morgan
On 14:24 Thu 29 Dec , Marco Calviani wrote: > i have files of the type: > > duck1.jpg > duck2.jpg > duck3.jpg > > and i would like them to become: > > donald_duck1.jpg > donald_duck2.jpg > donald_duck3.jpg > for i in duck*.jpg ; do mv ${i} donald_${i} ; done -- gentoo-user@gentoo.org mail

[gentoo-user] [OT] Filename modification with suffix

2005-12-29 Thread Marco Calviani
Hi list, maybe this question is a little bit related since it regards non Gentoo-specific topics. I would like to add a specific suffix to a list of files. For example i have files of the type: duck1.jpg duck2.jpg duck3.jpg and i would like them to become: donald_duck1.jpg donald_duck2.jpg do