The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-07-2009
jaysunn's Avatar
jaysunn jaysunn is offline
Registered User
  
 

Join Date: May 2009
Posts: 22
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
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 11:49 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0