Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more  

Go Back   Webmaster Forums - Webmaster forum for HTML, PHP, ASP, CSS and more > Linux Operating System > Programming / Scripts
User Name
Password

Closed Thread
 
LinkBack Thread Tools Search this Thread Display Modes
Old 09-05-2006, 04:17 AM   #1 (permalink)
Napsty
Junior Member
 
Napsty's Avatar
 
Join Date: Aug 2006
Location: Switzerland
Posts: 6
Default Add extension to filename with variable

Hello

Hope someone can help me since I couldnt find any good solution of my problem.

I have to add an extension to filenames. Sounds really easy I know but the problem is, the files have variables in it.

Example: zz105_MO zz105_DI zz105_MI etc.

So when I work with those files in scripts, I just use the variable zz105* for them.

Now I have to add the suffix .dmp to any of those files. How is this possible with several files?
Any help will be appreciated, even the simpliest solution

edit: Oh yeah... programming language is using bash/shell


Found the solution in another forum.. if someone wants to know:
for i in $(ls zz105*); do mv $i $i.dmp; done

Thanks to Leviathan in the linux-club.de forum

Last edited by Napsty : 09-05-2006 at 11:03 AM.
Napsty is offline  
Sponsored Links
Closed Thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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: 1.00
Points Per Thread: 11.00
Points Per Reply: 5.00



» Sponsors

» Links

» Affiliates
Web Hosting
Marketing Find
Merchant Select
SiteMap Builder
Host Compare
Dedicated Servers

» Links

» Sports Network
Paintball Forum
Football Forum
Hockey Forum
Golf Forum
Boxing Forum
Lacrosse Forum
Baseball Forum
SnowBoarding Forum
Soccer Forum
MMA Forum


All times are GMT -4. The time now is 06:07 AM.



LinkBacks Enabled by vBSEO 3.0.0 RC8
Webmaster Forums