Sponsored Content
Top Forums Shell Programming and Scripting Handle Configuration File with same name of Parameter in multiple Sections Post 302172935 by potro on Wednesday 5th of March 2008 05:52:55 AM
Old 03-05-2008
This doesn't work because the config file has many lines (text and other parameters) in between and the parameters position is not fixed.


[Billing]
#texttex
LocalIPAddress = 192.168.1.116
Another Parameter = xxx
ProcessorsNumber = 1
[Plugins]
ProcessorsNumber = 2
#text text
LocalIPAddress = 192.168.2.116
[Statistics]
#text text
#text text
LocalIPAddress = 192.168.3.116
#text text
ProcessorsNumber = 1
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to handle the Multiple Rows in the Database

Hi All, I have problem with database validations, actually my requirement is, my code will generate some seqno;s, which i have to check in database, whether the generated seqno;s are present in database or not, if the generated seqno;s are present in the database means, i need to generate... (2 Replies)
Discussion started by: hsekol
2 Replies

2. UNIX for Advanced & Expert Users

extract multiple sections of a file

I have a file that I need to parse multiple sections from the file. The file contains multiple lines that start with ST (Abunch of data) Then the file contains multiple lines that start with SE (Abunch of data) SE*30*0001 ... (1 Reply)
Discussion started by: rgentis
1 Replies

3. Shell Programming and Scripting

extract multiple sections of file

I have a file that I need to parse multiple sections from the file. The file contains multiple lines that start with ST (Abunch of data) Then the file contains multiple lines that start with SE (Abunch of data) SE*30*0001 ST*810*0002 I need all of the lines between and including these.... (6 Replies)
Discussion started by: rgentis
6 Replies

4. Shell Programming and Scripting

How to handle multiple rows in a file

I have a FILE a.txt which has the following data 113901.94,113901.94,56950.97,56950.97,NOT MATCHING,NOT MATCHING 10693.04,10693.04,5346.52,5346.52,NOT MATCHING,NOT MATCHING 1901.94,1901.94,550.97,550.97,NOT MATCHING,NOT MATCHING 103.04,103.04,53.52,53.52,NOT MATCHING,NOT MATCHING #### This... (2 Replies)
Discussion started by: ksmbabu
2 Replies

5. Shell Programming and Scripting

How to edit file sections that cross multiple lines?

Hello, I'm wondering where I could go to learn how to edit file sections that cross multiple lines. I'm wanting to write scripts that will add Gnome menu entries for all users on a system for scripts I write, etc. I can search an replace simple examples with sed, but this seems more complex. ... (8 Replies)
Discussion started by: Narnie
8 Replies

6. UNIX for Dummies Questions & Answers

how to handle multiple apps on host?

So, I'm going to install Oracle DB within my Suse host... Also, I would like to run Virtual Box and Tomcat.. ok, tomcat is going to be runnable app that will start at boot.. but, how to handle Oracle and virtual box? I would like to have an Oracle under it's own user, and to be able to use... (0 Replies)
Discussion started by: bongo
0 Replies

7. Shell Programming and Scripting

Multiple file and single parameter file

Hi Team, In our project we have written below 2 scripts like Script1: Shell script start & END Begin Audit process - uses teradata bteq END Audit Process Script 2: Environemtal variable file different Now Client ask to change this requirement and need below files: Script1:... (1 Reply)
Discussion started by: tusharzaware1
1 Replies

8. UNIX for Advanced & Expert Users

How does extundelete handle multiple versions of the same inode?

Hi, I noticed a weird behavior in extundelete way to choose the filename to which it will restore a given inode. Here is an example : root@rescue:~# for after in '' 0 740 741 $(date -d 'now - 1 year' +%s); do rm -rf RECOVERED_FILES/; echo -e "$(date -d@$after 2> /dev/null || echo No... (4 Replies)
Discussion started by: chebarbudo
4 Replies

9. Shell Programming and Scripting

CSV File with Multiple Search Parameter

Dear Team Members, I have a unique problem. Below is the dataset which I have. I am writing a script which will read through the file and pull the invoice no. (Field 2 of C1 row). "C1",990001,"L1","HERO","MOTORCYCLE","ASIA-PACIFIC","BEIJING" "C2","CLUTCH","HYUNDAI",03032017... (13 Replies)
Discussion started by: chetanojha
13 Replies

10. Shell Programming and Scripting

Replace multiple file by passing parameter value

Hello All, I want to change date part in file name to yesterday date in the file name. example file name file-12122017-06-30-41.dat want file-12112017-06-30-41.dat I am doing like below. Below it is not changing the filename. Actually it is not parsing the $today and $yesterday value in... (1 Reply)
Discussion started by: looney
1 Replies
JAIL.CONF(5)						      BSD File Formats Manual						      JAIL.CONF(5)

NAME
jail.conf -- configuration file for jail(8) DESCRIPTION
A jail(8) configuration file consists of one or more jail definitions statements, and parameter or variable statements within those jail def- initions. A jail definition statement looks something like a C compound statement. A parameter statement looks like a C assignment, includ- ing a terminating semicolon. The general syntax of a jail definition is: jailname { parameter = "value"; parameter = "value"; ... } Each jail is required to have a name at the front of its definition. This is used by jail(8) to specify a jail on the command line and report the jail status, and is also passed to the kernel when creating the jail. Parameters A jail is defined by a set of named parameters, specified inside the jail definition. See jail(8) for a list of jail parameters passed to the kernel, as well as internal parameters used when creating and removing jails. A typical parameter has a name and a value. Some parameters are boolean and may be specified with values of ``true'' or ``false'', or as valueless shortcuts, with a ``no'' prefix indicating a false value. For example, these are equivalent: allow.mount = "false"; allow.nomount; Other parameters may have more than one value. A comma-separated list of values may be set in a single statement, or an existing parameter list may be appended to using ``+='': ip4.addr = 10.1.1.1, 10.1.1.2, 10.1.1.3; ip4.addr = 10.1.1.1; ip4.addr += 10.1.1.2; ip4.addr += 10.1.1.3; Note the name parameter is implicitly set to the name in the jail definition. String format Parameter values, including jail names, can be single tokens or quoted strings. A token is any sequence of characters that aren't considered special in the syntax of the configuration file (such as a semicolon or whitespace). If a value contains anything more than letters, num- bers, dots, dashes and underscores, it is advisable to put quote marks around that value. Either single or double quotes may be used. Special characters may be quoted by preceding them with a backslash. Common C-style backslash character codes are also supported, including control characters and octal or hex ASCII codes. A backslash at the end of a line will ignore the subsequent newline and continue the string at the start of the next line. Variables A string may use shell-style variable substitution. A parameter or variable name preceded by a dollar sign, and possibly enclosed in braces, will be replaced with the value of that parameter or variable. For example, a jail's path may be defined in terms of its name or hostname: path = "/var/jail/$name"; path = "/var/jail/${host.hostname}"; Variable substitution occurs in unquoted tokens or in double-quoted strings, but not in single-quote strings. A variable is defined in the same way a parameter is, except that the variable name is preceded with a dollar sign: $parentdir = "/var/jail"; path = "$parentdir/$name"; The difference between parameters and variables is that variables are only used for substitution, while parameters are used both for substi- tution and for passing to the kernel. Wildcards A jail definition with a name of ``*'' is used to define wildcard parameters. Every defined jail will contain both the parameters from its own definition statement, as well as any parameters in a wildcard definition. Variable substitution is done on a per-jail basis, even when that substitution is for a parameter defined in a wildcard section. This is useful for wildcard parameters based on e.g. a jail's name. Later definitions in the configuration file supersede earlier ones, so a wildcard section placed before (above) a jail definition defines parameters that could be changed on a per-jail basis. Or a wildcard section placed after (below) all jails would contain parameters that always apply to every jail. Multiple wildcard statements are allowed, and wildcard parameters may also be specified outside of a jail defi- nition statement. If hierarchical jails are defined, a partial-matching wildcard definition may be specified. For example, a definition with a name of ``foo.*'' would apply to jails with names like ``foo.bar'' and ``foo.bar.baz''. Comments The configuration file may contain comments in the common C, C++, and shell formats: /* This is a C style comment. * It may span multiple lines. */ // This is a C++ style comment. # This is a shell style comment. Comments are legal wherever whitespace is allowed, i.e. anywhere except in the middle of a string or a token. EXAMPLES
# Typical static defaults: # Use the rc scripts to start and stop jails. Mount jail's /dev. exec.start = "/bin/sh /etc/rc"; exec.stop = "/bin/sh /etc/rc.shutdown"; exec.clean; mount.devfs; # Dynamic wildcard parameter: # Base the path off the jail name. path = "/var/jail/$name"; # A typical jail. foo { host.hostname = "foo.com"; ip4.addr = 10.1.1.1, 10.1.1.2, 10.1.1.3; } # This jail overrides the defaults defined above. bar { exec.start = ''; exec.stop = ''; path = /; mount.nodevfs; persist; // Required because there are no processes } SEE ALSO
jail_set(2), rc.conf(5), jail(8), jls(8) HISTORY
The jail(8) utility appeared in FreeBSD 4.0. The jail.conf file was added in FreeBSD 9.1. AUTHORS
The jail feature was written by Poul-Henning Kamp for R&D Associates http://www.rndassociates.com/ who contributed it to FreeBSD. James Gritton added the extensible jail parameters and configuration file. BSD
February 13, 2014 BSD
All times are GMT -4. The time now is 01:47 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy