Welcome to the GoFuckYourself.com - Adult Webmaster 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 and access many other special features. 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 us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 12-05-2006, 07:57 PM   #1
kuthi123
Confirmed User
 
Join Date: Jan 2005
Posts: 6,478
shell (bash) script help

I am looking for a shell script (using SSH or telnet access) to mass overwrite files (using ./overwrite.sh ) on my server.
for example, I have 100 domains on my server, and each of my server has 10 sub folders under public_html . each sub folder has example.php file and they are having some wrong code.i want to edit the code with new code..
i want shell script should overwrite example.php with new code on all domains all sub folders.Any help here?
kuthi123 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2006, 07:58 PM   #2
fris
Too lazy to set a custom title
 
fris's Avatar
 
Industry Role:
Join Date: Aug 2002
Posts: 55,372
smokey had something like this
__________________
Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.


WP Stuff
fris is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2006, 08:55 PM   #3
Peacemaker
Confirmed User
 
Peacemaker's Avatar
 
Join Date: Feb 2002
Location: Mars
Posts: 897
#!/bin/bash

path="/htdocs/users/*/public_html/example.php"
for a in `ls $path`; do
perl -pi -e "s/OLDTEXT/NEWTEXT/goi" $a
done






you have to enter the right path.. cant exactly see how your folders / domains are structured .. should work. havent tested it :}
__________________
SEO since 2002 - Google Index Record: 32 minutes. - Selling SEO services and tools

Last edited by Peacemaker; 12-05-2006 at 08:57 PM..
Peacemaker is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2006, 08:58 PM   #4
kuthi123
Confirmed User
 
Join Date: Jan 2005
Posts: 6,478
thanks peace maker i will try.
kuthi123 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2006, 08:59 PM   #5
Peacemaker
Confirmed User
 
Peacemaker's Avatar
 
Join Date: Feb 2002
Location: Mars
Posts: 897
no problem. if you need help. let me know.
__________________
SEO since 2002 - Google Index Record: 32 minutes. - Selling SEO services and tools
Peacemaker is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 12-05-2006, 09:58 PM   #6
PHP-CODER-FOR-HIRE
Confirmed User
 
Industry Role:
Join Date: Nov 2006
Posts: 1,090
Get in touch with me and I'll code it specifically for your needs.
__________________
PHP-CODER-FOR-HIRE is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.