Sponsored Content
Full Discussion: Generating a Config File
Top Forums UNIX for Dummies Questions & Answers Generating a Config File Post 302774915 by Yoda on Sunday 3rd of March 2013 07:58:51 PM
Old 03-03-2013
Code:
awk ' NR == 3 {
                $0 = $0 RS "new line to be added"
} NR == 7 {
                $0 = $0 RS "new line to be added"
} NR == 28 {
                $0 = $0 RS "new line to be added"
} 1 ' config_file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash Scripts - File generating

Forgive the daft requests - I'm still a learner :D I need a script so that I can test another script (I'm confused already) The script I am looking for should generate a new file in the same directory (called newfile1 or what ever) and also generate text within the new file (Hello world? What... (1 Reply)
Discussion started by: JayC89
1 Replies

2. Shell Programming and Scripting

Ksh - finding pattern in file and generating a new file

I am trying to find for the pattern in first 5 bytes of every line in a text file and then generate a new file with the pattern found. Example: expected pattern is '-' to be serached in first 5 bytes of file only. Input File ab-cd jan-09 ddddd jan09 cc-ww jan09 dsgdq jan-09 ... (2 Replies)
Discussion started by: net
2 Replies

3. UNIX for Dummies Questions & Answers

Generating different columns from same file

Hi, Our requirement is we have to create file from one file where all the rows from source file is converted into columns of the target file. For example Source file is : Status Report ABC Generated: 2009-05-05 08:49:47 Job start time=2009-05-05 08:43:43 Job end time=2009-05-05... (1 Reply)
Discussion started by: Amey Joshi
1 Replies

4. Shell Programming and Scripting

Performance issue in UNIX while generating .dat file from large text file

Hello Gurus, We are facing some performance issue in UNIX. If someone had faced such kind of issue in past please provide your suggestions on this . Problem Definition: /Few of load processes of our Finance Application are facing issue in UNIX when they uses a shell script having below... (19 Replies)
Discussion started by: KRAMA
19 Replies

5. Emergency UNIX and Linux Support

String search and generating file

Hi Gurus, I have a requirement as below I have text file a.txt which contains hi hello process update status Output for file Ok to Proceed no issues good data arrangement My requirement here is i need to read the file and check for the words "OK to Proceed" and if it is available... (14 Replies)
Discussion started by: pssandeep
14 Replies

6. Shell Programming and Scripting

parsing config file to create new config files

Hi, I want to use a config file as the base file and parse over the values of country and city parameters in the config file and generate separate config files as explained below. I will be using the config file as mentioned below: (config.txt) country:a,b city:1,2 type:b1... (1 Reply)
Discussion started by: clazzic
1 Replies

7. Shell Programming and Scripting

Shell script that will compare two config files and produce 2 outputs 1)actual config file 2)report

Hi I am new to shell scripting. There is a requirement to write a shell script to meet follwing needs.Prompt reply shall be highly appreciated. script that will compare two config files and produce 2 outputs - actual config file and a report indicating changes made. OS :Susi linux ver 10.3. ... (4 Replies)
Discussion started by: muraliinfy04
4 Replies

8. Shell Programming and Scripting

Generating file from sqlplus

Hi Frndz, I have req in which i need to run the query stored in some file and then store the resultset of the query in some other file. PFB the code i have written: #----Start job log--- SQLLOG='/opt/app/vertica2/cdr_dev/logs/conn_orac_db.log' ORA_USER='abc' ORA_PASSWD='xyz' ... (7 Replies)
Discussion started by: gnnsprapa
7 Replies

9. Shell Programming and Scripting

Check to see if a file is generating

Hi guys, I am pulling my hair out here. I have a file that comes in, once it finishes i want to move it to a new location. This sounds all very easy but my solution is failing and moves the file before it has finished generating. isrun=`ps -ef | grep -i filename | grep -v grep | wc -l` ... (8 Replies)
Discussion started by: twinion
8 Replies

10. Shell Programming and Scripting

Generating xml file from UNIX

i have a unix script which generates the csv file. the data in csv file is dynamic. how can i convert/move the data from csv file to xml. please suggest (1 Reply)
Discussion started by: archana25
1 Replies
Config::File(3pm)					User Contributed Perl Documentation					 Config::File(3pm)

NAME
Config::File - Parse a simple configuration file SYNOPSIS
use Config::File; my $config_hash = Config::File::read_config_file($configuration_file); DESCRIPTION
"read_config_file" parses a simple configuration file and stores its values in an anonymous hash reference. The syntax of the configuration file is as follows: # This is a comment VALUE_ONE = foo VALUE_TWO = $VALUE_ONE/bar VALUE_THREE = The value contains a # (hash). # This is a comment. Options can be clustered when creating groups: CLUSTER_ONE[data] = data cluster one CLUSTER_ONE[value] = value cluster one CLUSTER_TWO[data] = data cluster two CLUSTER_TWO[value] = value cluster two Then values can be fetched using this syntax: $hash_config->{CLUSTER_ONE}{data}; There can be as many sub-options in a cluster as needed. BIG_CLUSTER[part1][part2][part3] = data is fetched by: $hash_config->{BIG_CLUSTER}{part1}{part2}{part3}; There are a couple of restrictions as for the names of the keys. First of all, all the characters should be alphabetic, numeric, underscores or hyphens, with square brackets allowed for the clustering. That is, the keys should conform to /^[A-Za-z0-9_-]+$/ This means also that no space is allowed in the key part of the line. CLUSTER_ONE[data] = data cluster one # Right CLUSTER_ONE[ data ] = data cluster one # Wrong Function ";read_config_file" Syntax Config::File::read_config_file($file); Arguments $file is the configuration file. Return value This function returns a hash reference. Each key of the hash is a value defined in the configuration file. Description "read_config_file" parses a configuration file a sets up some values in a hash reference. NOTES
Function not exported by default In versions up to 1.0, the function read_config_file was exported to the calling program's namespace - Starting in version 1.1, nothing is exported by default. You can either fully qualify read_config_file or explicitly import it into your namespace: Fully qualifying read_config_file use Config::File; my $config_hash = Config::File::read_config_file($configuration_file); Explicitly importing read_config_file use Config::File qw(read_config_file); my $config_hash = read_config_file($configuration_file); Migrated away from ConfigFile into Config::File As of version 1.4, in order to include this module in the CPAN, I decided to move away from the highly unstandard name of ConfigFile and rename the module to Config::File. A small redirecting module is put in place, so current code using this module does not break, but the ConfigFile namespace usage is deprecated (and will thus issue a warning). Please update your code! AUTHOR
Development was started by Sebastien J. Gross <seb@sjgross.org>, and since 2003 it is maintained by Gunnar Wolf <gwolf@gwolf.org>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GPL. VERSION
Version 1.4 Copyright (c) 2002 Sebastien J. Gross. All rights reserved. Copyright (c) 2003-2009 Gunnar Wolf. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GPL v2 (or later, at your choice). perl v5.10.0 2009-02-20 Config::File(3pm)
All times are GMT -4. The time now is 12:58 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy