LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-07-2011, 07:26 AM   #1
Jalindar
LQ Newbie
 
Registered: Feb 2010
Posts: 14

Rep: Reputation: 0
Edit configuration files more than one server by shell script


Hi,

Can any one tell me, how to write shell script(awk/sed or any other) to edit value of parameters in configuration files on same server or remote server.

Thanx in advace...

Jalindar

Last edited by Jalindar; 02-07-2011 at 07:31 AM.
 
Old 02-07-2011, 09:52 AM   #2
marafa
LQ Newbie
 
Registered: Sep 2008
Posts: 26

Rep: Reputation: 1
hello jalindar

well to write that script you need the following:
1. unix (or call it linux if you prefer!)
2. a shell (bash, ksh, csh or zsh)
3. sed
4. awk
5. grep
6. cut
7. uniq
8. scripting knowledge

OR

clusterssh or dsh (distributed shell)

OR

a configuration management tool like puppet or bcfg2 or the like
 
Old 02-07-2011, 10:26 AM   #3
crts
Senior Member
 
Registered: Jan 2010
Posts: 2,020

Rep: Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757Reputation: 757
Hi,

here are some manuals/tutorials that should get you started:
http://www.gnu.org/manual/gawk/
http://www.grymoire.com/Unix/
http://tldp.org/LDP/abs/html/
 
Old 02-17-2011, 12:18 PM   #4
Jalindar
LQ Newbie
 
Registered: Feb 2010
Posts: 14

Original Poster
Rep: Reputation: 0
Hi Marafa,

Thanks replied to my post. I know that you said languages I need, but my problem is I tried to change configuration file using shell script, awk, sed, but didnt success.
My problem is how to replace the value of variable(s) in config file(s) through script?
for ex.
consider following from main.cf
default_process_limit=10
I want to change this value to 20 or 30 through script.
 
  


Reply



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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
edit help with .bat shell script visle Programming 1 03-28-2010 11:10 PM
Shell script to edit a file kaash_m31 Linux - Newbie 2 06-02-2008 05:43 AM
FTP files to remote server with a shell script Pezzoni Linux - Software 2 06-27-2007 07:01 AM
shell script for reading of configuration files nhydra Programming 2 06-13-2006 03:15 AM
Connection, login and upload files to ftp server via shell script Paulo Góes Linux - Networking 2 02-21-2004 01:01 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 09:34 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration