LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-06-2011, 07:17 AM   #1
Vilius
Member
 
Registered: Jan 2006
Location: Lithuania
Distribution: Arch, Debian
Posts: 193

Rep: Reputation: 16
Edit standard config file using script ?


Hello,

What I want to do is to find keyword in config file and change its value - that must be done using script.
I could write script usig awk and etc - but maybe there are already prepared ways/commands to change standard config file setting ?

thanks
Vilius
 
Old 01-06-2011, 08:09 AM   #2
Vilius
Member
 
Registered: Jan 2006
Location: Lithuania
Distribution: Arch, Debian
Posts: 193

Original Poster
Rep: Reputation: 16
Never mind I found it:
Code:
awk '{ sub(/^keyword1 value1/, "keyword1 value2"); print }' file.conf > file.conf
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
help to edit Edit my bootloader's config file from kernel prompt jagdishpandey Linux - Kernel 5 07-03-2007 06:59 AM
How to edit a config file in FC4? heffo_j Fedora 7 12-12-2005 09:20 PM
Edit which config file to allow for dif resolutions Glas Slackware 9 09-24-2004 01:26 AM
Simple question - how to edit config file in Suse 9.1? rollo Linux - Distributions 3 07-18-2004 08:47 AM
Really dumb question but how do I edit a config file ? gavinc Linux - Newbie 2 08-19-2003 01:14 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 06:37 AM.

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