It is currently Sat May 26, 2018 9:33 pm

Script for replacing of files

All times are UTC - 6 hours

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 PostPosted: Sat Jan 07, 2012 2:19 pm   

Joined: Sat Jan 07, 2012 1:49 pm
Posts: 1
I am very new in the bashscripting and this is my first post in that forum.
I want to ask if someone can help me with script for the following.

The script must can to create modified copyes of files. Please create a few files with different extensions (example: .txt, .dat) in a folder to test the functionality of the script.
Syntax of the script: <oldextension> <newextension> <pattern> <replacing>
All the files in the current directory, wich are having the same extension as from transfered parameter
and also the transfered <pattern> String containts, a new copy with the new extention create. The <pattern>string must be replaced with <replacing>.

Sorry for unprecisions in the text, but i am translating it from german.


 PostPosted: Tue Jan 17, 2012 10:06 pm   

Joined: Tue Jan 17, 2012 7:38 pm
Posts: 1
Sounds interresting ... <oldextension> <newextension> <pattern> <replacing>
Means: .txt .sh stuff_* new_stuff_* ???

So you could also say: <oldpattern> <newpattern>
This will replace a whatever.txt to

I have a similar script here. With a few modification it coud do the trick.
Do you need some kind of menu or fallback if the user didn't enter a <newpattern>?

Its done (mostly)!
Check the usage of this thing. You could do this a smarter way, but here you get the possibility to undo you changes (not really implemented).
At the moment you have to check the generated list which contains the cp stuff.
As always BEWARE of recursive settings ...

Maybe i do some undo stuff ... but atm im a byte out of time )=

Check here for updates of this one:

Like spamming, but:
Ive made a stupid mistake so i removed the script. I may rewrite it later. Not much time left for this these days )=

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 6 hours

Who is online

Users browsing this forum: Bing [Bot] and 5 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  

BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group