zsh-users
 help / color / mirror / code / Atom feed
* Upper case
@ 1999-10-25 19:54 Mircea Damian
  1999-10-25 21:50 ` Geoff Wing
  0 siblings, 1 reply; 7+ messages in thread
From: Mircea Damian @ 1999-10-25 19:54 UTC (permalink / raw)
  To: zsh-users


Hello,

I was wondering yesterday if there is a simple way to rename all my song
files(mp3) from


name with spaces.mp3   ->  Name With Spaces.mp3

with something like:
for i in *.mp3; do 
mv -v $i (UNKNOWN_PART_TO_ME)
done


I tried using sed there but with no luck. Can anyone give me a clue here?

-- 
Mircea Damian
E-mails: dmircea@kappa.ro, dmircea@roedu.net
WebPage: http://taz.mania.k.ro/~dmircea/


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Upper case
  1999-10-25 19:54 Upper case Mircea Damian
@ 1999-10-25 21:50 ` Geoff Wing
  1999-10-26  7:39   ` Mircea Damian
  1999-10-26 13:34   ` Upper case Andrei Zmievski
  0 siblings, 2 replies; 7+ messages in thread
From: Geoff Wing @ 1999-10-25 21:50 UTC (permalink / raw)
  To: zsh-users

Mircea Damian <dmircea@linux.kappa.ro> typed:
:I was wondering yesterday if there is a simple way to rename all my song
:files(mp3) from
:name with spaces.mp3   ->  Name With Spaces.mp3
:
:with something like:
:for i in *.mp3; do 
:mv -v $i (UNKNOWN_PART_TO_ME)

One way:
	mv $i ${${(C)i}:s/Mp3/mp3/}

:done

Regards,
-- 
Geoff Wing : <gcw@pobox.com>     Work URL: http://www.primenet.com.au/
Rxvt Stuff : <gcw@rxvt.org>      Ego URL : http://pobox.com/~gcw/
Zsh Stuff  : <gcw@zsh.org>       Phone   : (Australia) 0413 431 874


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Upper case
  1999-10-25 21:50 ` Geoff Wing
@ 1999-10-26  7:39   ` Mircea Damian
  1999-10-26 13:19     ` Mohamed LRHAZI
  1999-10-26 13:25     ` Upper case [correction] Mohamed LRHAZI
  1999-10-26 13:34   ` Upper case Andrei Zmievski
  1 sibling, 2 replies; 7+ messages in thread
From: Mircea Damian @ 1999-10-26  7:39 UTC (permalink / raw)
  To: Geoff Wing; +Cc: zsh-users

On Mon, Oct 25, 1999 at 09:50:15PM +0000, Geoff Wing wrote:
> Mircea Damian <dmircea@linux.kappa.ro> typed:
> :I was wondering yesterday if there is a simple way to rename all my song
> :files(mp3) from
> :name with spaces.mp3   ->  Name With Spaces.mp3
> :
> :with something like:
> :for i in *.mp3; do 
> :mv -v $i (UNKNOWN_PART_TO_ME)
> 
> One way:
> 	mv $i ${${(C)i}:s/Mp3/mp3/}
> 
> :done

Thanks a lot! I've seen "C" in the manual but I thought it would capitalize
all letters. That was a wrong thought! Thanks again!

It is far better than the perl RE that I used:
s/(?:^|(?<=\s))(\w)(\w+)(?:$|(?=\.)|(?=\s))/uc($1).$2/ge

:-)



> 
> Regards,

-- 
Mircea Damian
E-mails: dmircea@kappa.ro, dmircea@roedu.net
WebPage: http://taz.mania.k.ro/~dmircea/


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Upper case
  1999-10-26  7:39   ` Mircea Damian
@ 1999-10-26 13:19     ` Mohamed LRHAZI
  1999-10-26 13:25     ` Upper case [correction] Mohamed LRHAZI
  1 sibling, 0 replies; 7+ messages in thread
From: Mohamed LRHAZI @ 1999-10-26 13:19 UTC (permalink / raw)
  To: Mircea Damian, zsh-users

Hello all,

It shouldnt bother you, guys, to recieve some too simple questions from time to time hen? :)

I tried the solution :

for i in *.ps; do
mv  $i ${${(C)i}:s/ch/chap/}
done

I had these .ps files :

evol.ch2.37p.ps evol.ch3.54p.ps evol.intro.3p.ps  evol.ch1.13p.ps

my zsh command changed them to :

Evol.Evol.Ch3.54p.Ps  Ch1.13p.Ps Evol.Ch2.37p.Ps Evol.Intro.3p.Ps

I am using ZSH_VERSION=3.1.2 on solaris 7.

Yes, sorry, didnt read in man page on this, just hoped to learn this one w/o any efforts :)

Thanx.
Mohamed.



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Upper case [correction]
  1999-10-26  7:39   ` Mircea Damian
  1999-10-26 13:19     ` Mohamed LRHAZI
@ 1999-10-26 13:25     ` Mohamed LRHAZI
  1999-10-26 14:47       ` Mohamed LRHAZI
  1 sibling, 1 reply; 7+ messages in thread
From: Mohamed LRHAZI @ 1999-10-26 13:25 UTC (permalink / raw)
  To: Mircea Damian, zsh-users

Hello all,
(and sorry, made a mistake in my paste...)

It shouldnt bother you, guys, to recieve some too simple questions from time to time hen? :)

I tried the solution :

for i in *.ps; do
mv  $i ${${(C)i}:s/ch/chap/}
done

I had these .ps files :

evol.ch2.37p.ps evol.ch3.54p.ps evol.intro.3p.ps  evol.ch1.13p.ps

my zsh command changed them to :

Evol.Ch1.13p.Ps   Evol.Ch2.37p.Ps   Evol.Ch3.54p.Ps   Evol.Intro.3p.Ps

I am using ZSH_VERSION=3.1.2 on solaris 7.

Yes, sorry, didnt read in man page on this, just hoped to learn this one w/o any efforts :)

Thanx.
Mohamed.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Upper case
  1999-10-25 21:50 ` Geoff Wing
  1999-10-26  7:39   ` Mircea Damian
@ 1999-10-26 13:34   ` Andrei Zmievski
  1 sibling, 0 replies; 7+ messages in thread
From: Andrei Zmievski @ 1999-10-26 13:34 UTC (permalink / raw)
  To: Geoff Wing; +Cc: zsh-users

On Mon, 25 Oct 1999, Geoff Wing wrote:
> One way:
> 	mv $i ${${(C)i}:s/Mp3/mp3/}

Could someone explain this one to me, piece by piece? Obviously,
s/Mp3/mp3 does a substitution but what is ${${(C)i}} all about?

-Andrei
* Anything will fit if you push hard enough *


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: Upper case [correction]
  1999-10-26 13:25     ` Upper case [correction] Mohamed LRHAZI
@ 1999-10-26 14:47       ` Mohamed LRHAZI
  0 siblings, 0 replies; 7+ messages in thread
From: Mohamed LRHAZI @ 1999-10-26 14:47 UTC (permalink / raw)
  To: zsh-users

Sorry, I now got the point and fixed it :

# ls *.ps
evol.ch1.13p.ps   evol.ch2.37p.ps   evol.ch3.54p.ps

# for i in *.ps; do
mv $i ${i:s/ch/chap/}
done

# ls *.ps
evol.chap1.13p.ps  evol.chap2.37p.ps  evol.chap3.54p.ps

Mohamed~


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~1999-10-26 16:38 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-10-25 19:54 Upper case Mircea Damian
1999-10-25 21:50 ` Geoff Wing
1999-10-26  7:39   ` Mircea Damian
1999-10-26 13:19     ` Mohamed LRHAZI
1999-10-26 13:25     ` Upper case [correction] Mohamed LRHAZI
1999-10-26 14:47       ` Mohamed LRHAZI
1999-10-26 13:34   ` Upper case Andrei Zmievski

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).