Web Hosting Forum - Hosting Reviews, Web Hosting Discussion ForumCalendarContact Us

Welcome to the Web Hosting Forum - Hosting Reviews, Web Hosting Discussion Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content etc.

By registering you have access to many other special features, Like personal blogs, your own personal forum, extended profiles, posting of your resume, free links, photo galleries, auctions etc. We are Web 2.0 Compliant .

We also reward our posters and referals with free hosting, domains, prizes etc. Even earn points for reading posts. We offer contests, and events that are sure to please anyone in the hosting industry, web developer or SEO at heart.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Go Back   Web Hosting Forum - Hosting Reviews, Web Hosting Discussion Forum > The Operating Systems > Linux Hardware & Software > Misc Topics

Misc Topics Got something that dont fit, well jam it in here hehe.

Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old 01-08-2007, 09:15 PM
ray
 
Posts: n/a
mass renaming

Hi
I have files without any extension, I want to add html to the end.

findbis7?query=tree
findbis7?query=light
findbis7?query=vert
etc

findbis7?query=tree.html
findbis7?query=light.html
findbis7?query=vert.html
etc

I tried this command among many others and nothing works
ls -d *.* | sed 's/\(.*\).*$/mv "&" "\1.html"/' | sh

It would be nicer if I can get rid of
findbis7?query=

Please help me
Thanks

Reply With Quote
  #2 (permalink)  
Old 01-08-2007, 09:15 PM
Keith Keller
 
Posts: n/a
Re: mass renaming

On 2006-11-13, ray <ray_lokey7543@yahoo.com> wrote:
> I have files without any extension, I want to add html to the end.
>
> findbis7?query=tree
> findbis7?query=light
> findbis7?query=vert
> etc
>
> findbis7?query=tree.html
> findbis7?query=light.html
> findbis7?query=vert.html


I would try something like (untested)

for file in $(ls)
do
mv $file $file.html
done

(I'm sure a find would work too.)

>
> It would be nicer if I can get rid of
> findbis7?query=


There you might try rename. man rename has all the details you need.

--keith

--
kkeller-usenet@wombat.san-francisco.ca.us
(try just my userid to email me)
AOLSFAQ=http://www.therockgarden.ca/aolsfaq.txt
see X- headers for PGP signature information

Reply With Quote
  #3 (permalink)  
Old 01-08-2007, 09:15 PM
Chris F.A. Johnson
 
Posts: n/a
Re: mass renaming

On 2006-11-13, ray wrote:
> Hi
> I have files without any extension, I want to add html to the end.
>
> findbis7?query=tree
> findbis7?query=light
> findbis7?query=vert
> etc
>
> findbis7?query=tree.html
> findbis7?query=light.html
> findbis7?query=vert.html
> etc
>
> I tried this command among many others and nothing works
> ls -d *.* | sed 's/\(.*\).*$/mv "&" "\1.html"/' | sh
>
> It would be nicer if I can get rid of
> findbis7?query=


for file in findbis*
do
mv "$file" "${file#*=}.html"
done

--
Chris F.A. Johnson, author | <http://cfaj.freeshell.org>
Shell Scripting Recipes: | My code in this post, if any,
A Problem-Solution Approach | is released under the
2005, Apress | GNU General Public Licence
Reply With Quote
  #4 (permalink)  
Old 01-08-2007, 09:15 PM
John-Paul Stewart
 
Posts: n/a
Re: mass renaming

Keith Keller wrote:
> On 2006-11-13, ray <ray_lokey7543@yahoo.com> wrote:
>
>> It would be nicer if I can get rid of
>> findbis7?query=

>
> There you might try rename. man rename has all the details you need.


Beware, however, that there are two different 'rename' utilities. I
think either should work in this case, however.

http://wiki.linuxquestions.org/wiki/Rename
Reply With Quote
  #5 (permalink)  
Old 01-08-2007, 09:16 PM
Bill Marcum
 
Posts: n/a
Re: mass renaming

On 13 Nov 2006 13:57:21 -0800, ray
<ray_lokey7543@yahoo.com> wrote:
> Hi
> I have files without any extension, I want to add html to the end.
>
> findbis7?query=tree
> findbis7?query=light
> findbis7?query=vert
> etc
>
> findbis7?query=tree.html
> findbis7?query=light.html
> findbis7?query=vert.html
> etc
>
> I tried this command among many others and nothing works
> ls -d *.* | sed 's/\(.*\).*$/mv "&" "\1.html"/' | sh
>

Toto, we're not in Redmond anymore.
ls *.* lists filenames that contain "."

--
If one studies too zealously, one easily loses his pants.
-- A. Einstein.
Reply With Quote
  #6 (permalink)  
Old 01-08-2007, 10:03 PM
Oliver Joa
 
Posts: n/a
Re: mass renaming

Hi,

On Mon, 13 Nov 2006 13:57:21 -0800, ray wrote:

> Hi
> I have files without any extension, I want to add html to the end.
>
> findbis7?query=tree
> findbis7?query=light
> findbis7?query=vert
> etc
>
> findbis7?query=tree.html
> findbis7?query=light.html
> findbis7?query=vert.html
> etc
>
> I tried this command among many others and nothing works
> ls -d *.* | sed 's/\(.*\).*$/mv "&" "\1.html"/' | sh
>
> It would be nicer if I can get rid of
> findbis7?query=


you can try:

mmv "findbis7*" "findbis7#1.html"

regards

olli
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Points Per Thread View:
Points Per Thread:
Points Per Reply:

Similar Threads
Thread Thread Starter Forum Replies Last Post
HP 2210 Printer Scanner problems in 10.2 christine Suse 24 01-05-2007 02:24 AM
Re: [Samba] Trouble Renaming Computer Daniel Carmo Olops Samba 0 01-04-2007 08:08 PM
Make a linux box to act like an USB mass storage unit? J.O. Aho Gentoo 17 01-04-2007 06:12 AM
Mac Mass Mailer 1.0 (Default branch) admin Open Source 0 12-27-2006 09:22 AM


All times are GMT -5. The time now is 01:24 AM.


International Visitors Translate Hostingforum.ca here

Dedicated Hosting


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 Copyright 2008 Net Industries, LLC.