01-21-2012
Allright.
Operating System : ubuntu server 10.04
Shell : Bash
Objective : To add a line at the end of another line.
Example:
I want to add a SCGI Mount Point in apache2.conf. Everynew line will have a new value and it has to be below the previous written line.
This is what you'd see at the end of the apache2.conf file after lines and lines of text :
Quote:
...
...
...
...
# Include the virtual host configurations:
Include /etc/apache2/sites-enabled/
SCGIMount /RPC2 127.0.0.1:5000
I want to add SCGIMount /RPC3 127.0.0.1:5001 below the SCGIMount /RPC2 127.0.0.1:5000 line. Then in the future, i might add SCGIMount /RPC4 127.0.0.1:5002 below SCGIMount /RPC3 127.0.0.1:5001 and so on.
The script should ask me for the RPC value and the port value and then paste it in the conf file.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello, I'm absolutely new to this world... but I've a problem with a terminal connected via PuTTY (or Termlite) to an AIX 5.1 application.
The problem: I need to paste from clipboard a text containing both input text strings and special keys as ESC, Arrows and so on, to execute in the AIX... (1 Reply)
Discussion started by: Daniele11
1 Replies
2. UNIX for Dummies Questions & Answers
I've been away from Unix and the vi editor for a while, and now I'm using vi (actually vim) in a Cygwin bash shell. When I copy-and-paste code examples (I'm playing with perl now) any time I paste code with lines beginning with the # character, vi inserts a # character at the beginning of every... (2 Replies)
Discussion started by: greenmangroup
2 Replies
3. Shell Programming and Scripting
Hi All,
I need to create script which will accept one file as i/p and give me o/p file described as below.
1) i/p log file named abc.log contents several lines but i am interested in lines like below.
#FILE..... /oracle/XYZ/sapdata1/undo_7/undo.data7
#SAVED.... BACKINTID001
2) o/p... (4 Replies)
Discussion started by: paragp1981
4 Replies
4. Shell Programming and Scripting
Hi all,
I'm a unix newb andI'm trying to write a script that can copy some text paste it in a certian place and then add a number. It's not really clear but I'll show an example.
what the file looks like right now:
Linux 2.6.24-24-generic (abc) 07/15/09
23:25:01 CPU ... (6 Replies)
Discussion started by: the1hand3r
6 Replies
5. UNIX for Dummies Questions & Answers
Dear All,
I am working with windoes OS but remote a linux machine. I wonder the way to copy an paste some part of a huge file in linux machine.
the contain of file like as follow:
...
dump annealling all custom 10 anneal_*.dat id type x y z q
timestep 0.02
run 200000
Memory... (2 Replies)
Discussion started by: ariesto
2 Replies
6. Solaris
Hello,
Can anybody please tell me how we can copy and paste text from a word document into a text file that we are editing in vi? Is it possible to do that while we are editing the text file in vi in insert mode?
Thanks, (3 Replies)
Discussion started by: Pouchie1
3 Replies
7. OS X (Apple)
Hello,
I'm running OS X 10.7.4.
How can I paste text from the pasteboard into an open vim file?
Thanks! (21 Replies)
Discussion started by: palex
21 Replies
8. UNIX for Dummies Questions & Answers
hi,
I have Multiple files with the following data :
File1
100414 DR1
END
XXXXX
Test1 Test2 Test3
Test4 Test5 Test6
END
100514 DR2
END
XXXXX
Test7 Test8 Test9
Test10 Test11 Test12
END
100614 DR3 (5 Replies)
Discussion started by: newageBATMAN
5 Replies
9. Shell Programming and Scripting
I have a really big XML file. I need copy the value of one tag inside another one tag. I try to publish one example.
<channel update="i" site="merge-xmltv" site_id="" xmltv_id="Rai 1">Rai 1</channel>
<channel update="i" site="merge-xmltv" site_id="" xmltv_id="Rai 1 +2HD">Rai 1... (6 Replies)
Discussion started by: Tapiocapioca
6 Replies
10. Shell Programming and Scripting
Hi I have a text file with lines beginning with 71303, 71403, 71602,
I need to copy the 10 digit text at position 30 on lines beginning with 71303 (5500011446) to position 99 on every line beginning with 71602 (see example below),
There may be many 71303 lines but I need the text copying to... (2 Replies)
Discussion started by: firefox2k2
2 Replies
LEARN ABOUT NETBSD
resolvconf.conf
RESOLVCONF.CONF(5) System Manager's Manual RESOLVCONF.CONF(5)
NAME
resolvconf.conf -- resolvconf configuration file
DESCRIPTION
resolvconf.conf is the configuration file for resolvconf(8). The resolvconf.conf file is a shell script that is sourced by resolvconf(8),
meaning that resolvconf.conf must contain valid shell commands. Listed below are the standard resolvconf.conf variables that may be set.
After updating this file, you may wish to run resolvconf -u to apply the new configuration.
RESOLVCONF OPTIONS
interface_order
These interfaces will always be processed first. If unset, defaults to the following:-
lo lo[0-9]*
dynamic_order
These interfaces will be processed next, unless they have a metric. If unset, defaults to the following:-
tap[0-9]* tun[0-9]* vpn vpn[0-9]* ppp[0-9]* ippp[0-9]*
search_domains
Prepend search domains to the dynamically generated list.
search_domains_append
Append search domains to the dynamically generated list.
name_servers
Prepend name servers to the dynamically generated list. You should set this to 127.0.0.1 if you use a local name server other than
libc.
name_servers_append
Append name servers to the dynamically generated list.
private_interfaces
These interfaces name servers will only be queried for the domains listed in their resolv.conf. Useful for VPN domains. This is
equivalent to the resolvconf -p option.
state_dir
Override the default state directory of /var/run/resolvconf. This should not be changed once resolvconf is in use unless the old
directory is copied to the new one.
LIBC OPTIONS
The following variables affect resolv.conf(5) directly:-
resolv_conf
Defaults to /etc/resolv.conf if not set.
resolv_conf_options
A list of libc resolver options, as specified in resolv.conf(5).
resolv_conf_passthrough
When set to YES the latest resolv.conf is written to resolv_conf without any alteration.
resolv_conf_sortlist
A libc resolver sortlist, as specified in resolv.conf(5).
SUBSCRIBER OPTIONS
openresolv ships with subscribers for the name servers dnsmasq(8), named(8), pdnsd(8) and unbound(8). Each subscriber can create configura-
tion files which should be included in in the subscribers main configuration file.
dnsmasq_conf
This file tells dnsmasq which nameservers to use for specific domains.
dnsmasq_resolv
This file tells dnsmasq which nameservers to use for global lookups.
Example resolvconf.conf for dnsmasq:
nameservers=127.0.0.1
dnsmasq_conf=/etc/dnsmasq-conf.conf
dnsmasq_resolv=/etc/dnsmasq-resolv.conf
Example dnsmasq.conf:
listen-address=127.0.0.1
conf-file=/etc/dnsmasq-conf.conf
resolv-file=/etc/dnsmasq-resolv.conf
named_options
Include this file in the named options block. This file tells named which nameservers to use for global lookups.
named_zones
Include this file in the named global scope, after the options block. This file tells named which nameservers to use for specific
domains.
Example resolvconf.conf for named:
nameservers=127.0.0.1
named_options=/etc/named-options.conf
named_zones=/etc/named-zones.conf
Example named.conf:
options {
listen-on { 127.0.0.1; };
include /etc/named-options.conf;
};
include /etc/named-zones.conf;
pdnsd_conf
This is the main pdnsd configuration file which we modify to add our forward domains to. If this variable is not set then we rely on
the pdnsd configuration file setup to read pdnsd_resolv as documented below.
pdnsd_resolv
This file tells pdnsd about global nameservers. If this variable is not set then it's written to pdnsd_conf.
Example resolvconf.conf for pdnsd:
nameservers=127.0.0.1
pdnsd_conf=/etc/pdnsd.conf
# pdnsd_resolv=/etc/pdnsd-resolv.conf
Example pdnsd.conf:
global {
server_ip = 127.0.0.1;
status_ctl = on;
}
server {
# A server definition is required, even if emtpy.
label="empty";
proxy_only=on;
# file="/etc/pdnsd-resolv.conf";
}
unbound_conf
This file tells unbound about specific and global nameservers.
Example resolvconf.conf for unbound:
nameservers=127.0.0.1
unbound_conf=/etc/unbound-resolvconf.conf
Example unbound.conf:
include: /etc/unbound-resolvconf.conf
SEE ALSO
resolv.conf(5) and resolvconf(8).
AUTHORS
Roy Marples <roy@marples.name>
BUGS
Please report them to http://roy.marples.name/projects/openresolv
BSD
August 11, 2011 BSD