![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Assistance needed with perl script | SkySmart | Shell Programming and Scripting | 5 | 03-17-2009 06:36 PM |
| shell script assistance please | xinoo | Shell Programming and Scripting | 5 | 08-05-2008 12:18 PM |
| need assistance ----SH schell script | shahidbakshi | Shell Programming and Scripting | 2 | 02-22-2008 06:28 AM |
| Need a little assistance with a shell script | rickou812 | Shell Programming and Scripting | 3 | 02-04-2008 04:18 AM |
| KSH Script Assistance | Brusimm | Shell Programming and Scripting | 3 | 05-10-2007 09:15 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|||||
|
Shell Script Assistance
I am looking for a shell script or command to automate a process of opening many files in a directory and changing a string of text. Example: I have a apache web server that uses virtual hosting. There are approximately 2300 vhost entries or files. So in the directory /usr/local/apache/conf/vhosts/ there are 2300 files like this: Code:
<virtualhost *> ServerName xxx ServerAlias xxx DocumentRoot /export/home/phpuser/docrootx/kuph DirectoryIndex index.php ServerAdmin xxx@xxx.com <Directory /export/home/phpuser/docrootx/kuph> RewriteEngine On RewriteBase / RewriteRule ^(.*)/([0-9]+)$ /pages/$2\.php Options +FollowSymLinks -Indexes </Directory> ErrorDocument 404 /stn_page_server.php ErrorDocument 403 /stn_page_server.php CustomLog logs/thefox969/access_log combined ErrorLog logs/thefox969/error_log </virtualhost> The goal that I have is I want to place a # in front of ErrorLog to disable logging on all 2300 vhosts. I am sure this can be done with SED or PERL. Either way would be fine. Also I have to do bulk edits on these vhosts alot. I would like to be able to modify this script as needed. For redirects and aliases etc... Thanks for your help Jaysunn Last edited by DukeNuke2; 05-08-2009 at 04:14 AM.. |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|