RE: [newbie] change case

2003-07-16 Thread Klar Brian D Contr MSG/SICN
There is a prog called chgcase that does this. 
I found it on Google.

Brian D. Klar - CVE
Multimax 
Network Engineer
WPAFB



-Original Message-
From: Todd Slater [mailto:[EMAIL PROTECTED]
Sent: Tuesday, July 15, 2003 10:58 PM
To: [EMAIL PROTECTED]
Subject: Re: [newbie] change case


On Tue, 15 Jul 2003 21:53:15 -0500
Chris <[EMAIL PROTECTED]> wrote:

> On Tuesday 15 July 2003 09:25 pm, Todd Slater wrote:
> > On Tue, 15 Jul 2003 20:35:15 -0500
> >
> > Chris <[EMAIL PROTECTED]> wrote:
> > > At one time a long ways back someone posted, I think it was a
> > > small script file to change the case of file extensions, ie..MP3
> > > to .mp3. Does anyone have that laying around?  I've been googling
> > > and found a few, but none seem to work correctly.
> > >
> > > Thanks
> > > Chris
> >
> > Or, to change *all* extensions to lowercase:
> > (assuming you are in the directory you want to do this)
> >
> > #/bin/bash
> > for i in *
> > do
> > name=`echo $i|cut -d '.' -f 1`
> > ext=".`echo $i|cut -d '.' -f 2|tr [A-Z] [a-z]`"
> > echo "$i : $name$ext"
> > #   mv "$i" "$name$ext"
> > done
> >
> > Assuming that your filenames don't have '.' in the name other than
> > to denote extension.
> >
> > Todd
> 
> Thanks Todd, this looks more like what I want, have a slight problem
> though as shown below with the output:
> 
> usr/local/bin/chgcase: line 4: Â : command not found
> /usr/local/bin/chgcase: line 5: Â : command not found
> /usr/local/bin/chgcase: line 6: Â : command not found
> [EMAIL PROTECTED] ACDC - High Voltage]$
> 
> Made it executable, made a symbolic link from /home/chris to
> /usr/local/bin.  When run chgcase *.MP3 *.mp3 the output is as above. 
> I'm sure I've used this script before but I don't remembe how.
> 
> Thanks
> Chris

Hi Chris,

You don't have to add any arguments to the script I wrote, just run it.
Note that it will change the extension for *all* files in the directory,
so .DOC > .doc, .PDF > .pdf etc. I sent another script that hasn't been
distributed yet for *just* .MP3 to.mp3. Here it is again in case it got
lost.

#/bin/bash
for i in *.MP3
do
name=`echo $i |sed s/'.MP3'//`
ext=".mp3"
echo "$i : $name$ext"
#   mv "$i" "$name$ext"
done


-- 
Let us be utopian for a moment so that when we get realistic again it
is not that "realism" so useful to the Establishment in discouraging
action. -Howard Zinn


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] change case

2003-07-15 Thread Chris
On Tuesday 15 July 2003 09:25 pm, Todd Slater wrote:
> On Tue, 15 Jul 2003 20:35:15 -0500
>
> Chris <[EMAIL PROTECTED]> wrote:
> > At one time a long ways back someone posted, I think it was a small
> > script file to change the case of file extensions, ie..MP3 to .mp3.
> > Does anyone have that laying around?  I've been googling and found a
> > few, but none seem to work correctly.
> >
> > Thanks
> > Chris
>
> Or, to change *all* extensions to lowercase:
> (assuming you are in the directory you want to do this)
>
> #/bin/bash
> for i in *
> do
> name=`echo $i|cut -d '.' -f 1`
> ext=".`echo $i|cut -d '.' -f 2|tr [A-Z] [a-z]`"
> echo "$i : $name$ext"
> #   mv "$i" "$name$ext"
> done
>
> Assuming that your filenames don't have '.' in the name other than to
> denote extension.
>
> Todd

Thanks Todd, this looks more like what I want, have a slight problem though as 
shown below with the output:

usr/local/bin/chgcase: line 4: Â : command not found
/usr/local/bin/chgcase: line 5: Â : command not found
/usr/local/bin/chgcase: line 6: Â : command not found
[EMAIL PROTECTED] ACDC - High Voltage]$

Made it executable, made a symbolic link from /home/chris to /usr/local/bin.  
When run chgcase *.MP3 *.mp3 the output is as above.  I'm sure I've used this 
script before but I don't remembe how.

Thanks
Chris

-- 
  Regards
  Chris
  A 100% Microsoft free computer
  Registered Linux User 283774 http://counter.li.org
  9:49pm  up 24 days,  4:03,  6 users,  load average: 2.44, 2.13, 1.64


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] change case

2003-07-15 Thread Chris
On Tuesday 15 July 2003 09:09 pm, Todd Slater wrote:
> On Tue, 15 Jul 2003 20:35:15 -0500

> Do you have a lot of different extensions you want to change? This can
> give you an idea, changing *only* the extension to lowercase. Works with
> files with spaces in the name, too. Test it first, then uncomment the mv
> line.
>
> #/bin/bash
> for i in *.MP3
> do
> name=`echo $i |sed s/'.MP3'//`
> ext=".mp3"
> echo "$i : $name$ext"
> #   mv "$i" "$name$ext"
> done
>
>
> Todd

That worked great Todd, excatly what I'm looking for.  Chcase is nice, but it 
changes the comple file name to lower case, of course the author says to use 
perl expressions to limit this, but thats beyond stil at this point.  This 
does excatly what I want.

Thanks again
Chris

-- 
  Regards
  Chris
  A 100% Microsoft free computer
  Registered Linux User 283774 http://counter.li.org
 10:18pm  up 24 days,  4:32,  6 users,  load average: 0.01, 0.05, 0.30


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] change case

2003-07-15 Thread Todd Slater
On Tue, 15 Jul 2003 21:53:15 -0500
Chris <[EMAIL PROTECTED]> wrote:

> On Tuesday 15 July 2003 09:25 pm, Todd Slater wrote:
> > On Tue, 15 Jul 2003 20:35:15 -0500
> >
> > Chris <[EMAIL PROTECTED]> wrote:
> > > At one time a long ways back someone posted, I think it was a
> > > small script file to change the case of file extensions, ie..MP3
> > > to .mp3. Does anyone have that laying around?  I've been googling
> > > and found a few, but none seem to work correctly.
> > >
> > > Thanks
> > > Chris
> >
> > Or, to change *all* extensions to lowercase:
> > (assuming you are in the directory you want to do this)
> >
> > #/bin/bash
> > for i in *
> > do
> > name=`echo $i|cut -d '.' -f 1`
> > ext=".`echo $i|cut -d '.' -f 2|tr [A-Z] [a-z]`"
> > echo "$i : $name$ext"
> > #   mv "$i" "$name$ext"
> > done
> >
> > Assuming that your filenames don't have '.' in the name other than
> > to denote extension.
> >
> > Todd
> 
> Thanks Todd, this looks more like what I want, have a slight problem
> though as shown below with the output:
> 
> usr/local/bin/chgcase: line 4: Â : command not found
> /usr/local/bin/chgcase: line 5: Â : command not found
> /usr/local/bin/chgcase: line 6: Â : command not found
> [EMAIL PROTECTED] ACDC - High Voltage]$
> 
> Made it executable, made a symbolic link from /home/chris to
> /usr/local/bin.  When run chgcase *.MP3 *.mp3 the output is as above. 
> I'm sure I've used this script before but I don't remembe how.
> 
> Thanks
> Chris

Hi Chris,

You don't have to add any arguments to the script I wrote, just run it.
Note that it will change the extension for *all* files in the directory,
so .DOC > .doc, .PDF > .pdf etc. I sent another script that hasn't been
distributed yet for *just* .MP3 to.mp3. Here it is again in case it got
lost.

#/bin/bash
for i in *.MP3
do
name=`echo $i |sed s/'.MP3'//`
ext=".mp3"
echo "$i : $name$ext"
#   mv "$i" "$name$ext"
done


-- 
Let us be utopian for a moment so that when we get realistic again it
is not that "realism" so useful to the Establishment in discouraging
action. -Howard Zinn

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] change case

2003-07-15 Thread Chris
On Tuesday 15 July 2003 09:09 pm, Todd Slater wrote:
> On Tue, 15 Jul 2003 20:35:15 -0500
>
> Chris <[EMAIL PROTECTED]> wrote:
> > At one time a long ways back someone posted, I think it was a small
> > script file to change the case of file extensions, ie..MP3 to .mp3.
> > Does anyone have that laying around?  I've been googling and found a
> > few, but none seem to work correctly.
> >
> > Thanks
> > Chris
>
> Do you have a lot of different extensions you want to change? This can
> give you an idea, changing *only* the extension to lowercase. Works with
> files with spaces in the name, too. Test it first, then uncomment the mv
> line.
>
> #/bin/bash
> for i in *.MP3
> do
> name=`echo $i |sed s/'.MP3'//`
> ext=".mp3"
> echo "$i : $name$ext"
> #   mv "$i" "$name$ext"
> done
>
>
> Todd

Boy, the mail is really a mess, this came in after the message I just replied 
to.  Maybe thats my problem.

-- 
  Regards
  Chris
  A 100% Microsoft free computer
  Registered Linux User 283774 http://counter.li.org
  9:55pm  up 24 days,  4:09,  6 users,  load average: 0.16, 0.79, 1.18


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] change case

2003-07-15 Thread Todd Slater
On Tue, 15 Jul 2003 20:35:15 -0500
Chris <[EMAIL PROTECTED]> wrote:

> At one time a long ways back someone posted, I think it was a small
> script file to change the case of file extensions, ie..MP3 to .mp3. 
> Does anyone have that laying around?  I've been googling and found a
> few, but none seem to work correctly.
> 
> Thanks
> Chris

Or, to change *all* extensions to lowercase:
(assuming you are in the directory you want to do this)

#/bin/bash
for i in *
do
name=`echo $i|cut -d '.' -f 1`
ext=".`echo $i|cut -d '.' -f 2|tr [A-Z] [a-z]`"
echo "$i : $name$ext"
#   mv "$i" "$name$ext"
done

Assuming that your filenames don't have '.' in the name other than to
denote extension.

Todd

-- 
The right of the people to be secure in their persons, houses, papers,
and effects, against unreasonable searches and seizures, shall not be
violated, and no warrants shall issue, but upon probable cause,
supported by oath or affirmation, and particularly describing the place
to be searched, and the persons or things to be seized.

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [newbie] change case

2003-07-15 Thread Todd Slater
On Tue, 15 Jul 2003 20:35:15 -0500
Chris <[EMAIL PROTECTED]> wrote:

> At one time a long ways back someone posted, I think it was a small
> script file to change the case of file extensions, ie..MP3 to .mp3. 
> Does anyone have that laying around?  I've been googling and found a
> few, but none seem to work correctly.
> 
> Thanks
> Chris

Do you have a lot of different extensions you want to change? This can
give you an idea, changing *only* the extension to lowercase. Works with
files with spaces in the name, too. Test it first, then uncomment the mv
line.

#/bin/bash
for i in *.MP3
do
name=`echo $i |sed s/'.MP3'//`
ext=".mp3"
echo "$i : $name$ext"
#   mv "$i" "$name$ext"
done


Todd


-- 
Reclaim the flag: http://www.pbs.org/now/commentary/moyers19.html

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


[newbie] change case

2003-07-15 Thread Chris
Please disregard my last message, I was looking for chgcase when I should have 
been looking for chcase.  Found it.

Chris

-- 
  Regards
  Chris
  A 100% Microsoft free computer
  Registered Linux User 283774 http://counter.li.org
  8:59pm  up 24 days,  3:13,  6 users,  load average: 0.00, 0.08, 0.31


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


[newbie] change case

2003-07-15 Thread Chris
At one time a long ways back someone posted, I think it was a small script 
file to change the case of file extensions, ie..MP3 to .mp3.  Does anyone 
have that laying around?  I've been googling and found a few, but none seem 
to work correctly.

Thanks
Chris

-- 
  Regards
  Chris
  A 100% Microsoft free computer
  Registered Linux User 283774 http://counter.li.org
  8:33pm  up 24 days,  2:47,  6 users,  load average: 1.32, 1.41, 0.90


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com