GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   shell (bash) script help (https://gfy.com/showthread.php?t=684055)

kuthi123 12-05-2006 07:57 PM

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?

fris 12-05-2006 07:58 PM

smokey had something like this

Peacemaker 12-05-2006 08:55 PM

#!/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 :}

kuthi123 12-05-2006 08:58 PM

thanks peace maker i will try.

Peacemaker 12-05-2006 08:59 PM

no problem. if you need help. let me know.

PHP-CODER-FOR-HIRE 12-05-2006 09:58 PM

Get in touch with me and I'll code it specifically for your needs.


All times are GMT -7. The time now is 12:44 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123