Sponsored Content
Top Forums Shell Programming and Scripting Help with dynamic configure cfg files Post 302423250 by suryanarayan on Thursday 20th of May 2010 12:46:33 PM
Old 05-20-2010
Wrench Help with dynamic configure cfg files

hi; i have one configuration file(configuration.cfg),where contents are below..
Code:
filename = charge.cfg
sectionname = [AUTORETRYTIMES]
networkid[1] = 1
retrytimes[1] = 2
-------------
--------------
sectionname = [CHARGE]
networkid[2] = 1
retrytimes[2] = 2
filename = xyz.cfg
------------------
-----------------

There is multiple filename & section name's.
How i read filename and section name and also between lines in two diff. sections dynamically ?
Then search as per filename in config directory,if found,then search for section name,if found then append/insert the lines in that file in shell script(linux).

Last edited by Scott; 05-20-2010 at 02:02 PM.. Reason: Please use code tags
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

How to Read config (.cfg) files using shell scripting

Hello Friends I am new to this forum and this is my first post. I have to write a script in which i have to read data from a configuration ( .cfg) file. And also i have to execute/call some already written scripts from this script. Can you people plpease help me on this regards. Thanks... (5 Replies)
Discussion started by: smallwonder
5 Replies

2. HP-UX

dynamic names for .tar.gz files?

Hi All, I have a requirement to zip and compress files with dynamic names (which includes date and time component in their names) needs to be compressed with same name. for example I have a file T.30.SLS_ORD.SO.27.2_2_2.20080623.041415.dat which needs to archived as... (1 Reply)
Discussion started by: srinivas_paluku
1 Replies

3. UNIX for Dummies Questions & Answers

Problem with shared dynamic library files

I am having a major problem. Most of the commands that i am running on my centos 5 system is giving the error of type: <dynamic shared library file>:open failed: No such file or directory For example: libgcc_s.so.1: open failed: No such file or directory How can i solve this? (6 Replies)
Discussion started by: proactiveaditya
6 Replies

4. UNIX for Advanced & Expert Users

Dynamic Downloading and executing of ELF files

Dear Group, I want to prepare an ELF file which can be downloaded dynamically to any address in the moemory and executes as a new task/thread/process. 1) for this what are all the compileation, linker options while building the ELF file? 2) which parts of ELF file has to modified while... (1 Reply)
Discussion started by: ravinder.are
1 Replies

5. BSD

configure /usr/local/etc/be-agent.cfg

hi Howto configure Ralus at /usr/local/etc/be-agent.cfg on freeBSD 7.0 for Backup Exec 9.1? I've tried the following: # cat /usr/local/etc/be-agent.cfg name bsd.domain export / as root export /usr as usr export /var as var export /tmp as tmp force_address 10.10.1.50 tell... (0 Replies)
Discussion started by: ccc
0 Replies

6. Shell Programming and Scripting

Help - Using Find command on dynamic files on KSH

Hi Forum. When I run the following find command, I get the desired results: find . \( -name a.out -o -name '*.o' -o -name 'core' \) -type f -ls I want for my script to dynamically calculate and assign a variable var1 to contain all the files that I want to search instead of hard-coding. ... (2 Replies)
Discussion started by: pchang
2 Replies

7. Red Hat

Help in ANACONDA-ks.cfg

i have automated installation of my proprietory linux.. using PXE. it all goes well. but after complete installation, while using the admin interface.. i am facing display problems. is it due to package dependencies.? or i have to write post script in anaconda-ks.cfg file??? can some one tell... (10 Replies)
Discussion started by: jayesh_j
10 Replies

8. Solaris

Configure network in unix with dynamic ip on my DHCP server?

can anyone tell me how can i configure network in unix with dynamic ip on my DHCP server?? (7 Replies)
Discussion started by: Reham.Donia
7 Replies

9. Shell Programming and Scripting

Help Dynamic looping based on files

Hi I have to run the script (a part of the code) in a loop for the no of times the files present in the directory, by taking one file and process and next another file. For example, if we do ls and the result have: $ls abc.dat def.dat ghi.dat The script code should loop for 3... (4 Replies)
Discussion started by: karumudi7
4 Replies

10. Red Hat

Kickstart using anaconda-ks.cfg

Heyas I'm trying to build a live image using livecd-tools (livecd-creator), but this time i'd like to reuse the /root/anaconda-ks.cfg. System: Fedora 3.16.7-200.fc20.x86_64 The building starts, the download begins, but it fails with networking. MAIN.ks # Based on: fedora-live-base.ks... (0 Replies)
Discussion started by: sea
0 Replies
ELFCOPY(1)						    BSD General Commands Manual 						ELFCOPY(1)

NAME
elfcopy -- copy and translate object files SYNOPSIS
elfcopy [-I objformat | -s objformat | --input-target=objformat] [-K symbolname | --keep-symbol=symbolname] [-L symbolname | --localize-symbol=symbolname] [-N symbolname | --strip-symbol=symbolname] [-O objformat | --output-target=objformat] [-R sectionname | --remove-section=sectionname] [-S | --strip-all] [-V | --version] [-W symbolname | --weaken-symbol=symbolname] [-X | --discard-locals] [-d | -g | --strip-debug] [-h | --help] [-j sectionname | --only-section=sectionname] [-p | --preserve-dates] [-w | --wildcard] [-x | --discard-all] [--add-section sectionname=filename] [--adjust-section-vma section{+|-|=}val | --change-section-address section{+|-|=}val] [--adjust-start=increment | --change-start=increment] [--adjust-vma=increment | --change-addresses=increment] [--adjust-warnings | --change-warnings] [--change-section-lma section{+|-|=}val] [--change-section-vma section{+|-|=}val] [--gap-fill=val] [--no-adjust-warnings | --no-change-warnings] [--only-keep-debug] [--pad-to=address] [--prefix-alloc-sections=string] [--prefix-sections=string] [--prefix-symbols=string] [--rename-section oldname=newname[,flags]] [--set-section-flags sectionname=flags] [--set-start=address] [--srec-forceS3] [--srec-len=val] [--strip-unneeded] infile [outfile] DESCRIPTION
The elfcopy utility copies the content of the ELF object named by argument infile to that named by argument outfile, transforming it accord- ing to the command line options specified. If argument outfile is not specified, elfcopy will create a temporary file and will subsequently rename it as infile. The elfcopy utility supports the following options: -I objformat | -s objformat | --input-target=objformat Specify that the input file named by the argument infile is in the object format specified by the argument objformat. -K symbolname | --keep-symbol=symbolname Copy the symbol named by argument symbolname to the output. -L symbolname | --localize-symbol=symbolname Make the symbol named by argument symbolname local to the output file. -N symbol | --strip-symbol=symbolname Do not copy the symbol named by argument symbolname to the output. -O objformat | --output-target=objformat Write the output file using the object format specified in argument objformat. -R sectionname | --remove-section=sectionname Remove any section with name sectionname from the output file. -S | --strip-all Do not copy symbol and relocation information to the target file. -V | --version Print a version identifier and exit. -W symbolname | --weaken-symbol=symbolname Mark the symbol named by argument symbolname as weak in the output. -X | --discard-locals Do not copy compiler generated local symbols to the output. -d | -g | --strip-debug Do not copy debugging information to the target file. -h | --help Display a help message and exit. -j sectionname | --only-section=sectionname Copy only the section named by argument sectionname to the output. -p | --preserve-dates Set the access and modification times of the output file to the same as those of the input. -w | --wildcard Use shell-style patterns to name symbols. The following meta-characters are recognized in patterns: ! If this is the first character of the pattern, invert the sense of the pattern match. * Matches any string of characters in a symbol name. ? Matches zero or one character in a symbol name. [ Mark the start of a character class. Remove the special meaning of the next character in the pattern. ] Mark the end of a character class. -x | --discard-all Do not copy non-global symbols to the output. --add-section sectionname=filename Add a new section to the output file with name sectionname. The contents of the section are taken from the file named by argument filename. The size of the section will be the number of bytes in file filename. --adjust-section-vma section{+|-|=}val | --change-section-address section{+|-|=}val Depending on the operator specified, increase, decrease or set both the virtual memory address and the load memory address of the section named by the argument section. The argument val specifies the desired increment, decrement or new value for the address. --adjust-start=increment | --change-start=increment Increase the entry point address of the output ELF object by the value specified in the argument increment. --adjust-vma=increment | --change-addresses=increment Increase the virtual memory address and the load memory address of all sections by the value specified by the argument increment. --adjust-warnings | --change-warnings Issue a warning if the section specified by the options --change-section-address, --change-section-lma or --change-section-vma does not exist in the input object. This is the default. --change-section-lma section{+|-|=}val Change or set the load memory address of the section named by the argument section. Depending on the operator specified, the value in argument val will be used as an increment, a decrement or as the new value of the load memory address. --change-section-vma section{+|-|=}val Change or set the virtual memory address of the section named by the argument section. Depending on the operator specified, the value in argument val will be used as an increment, a decrement or as the new value of the virtual memory address. --gap-fill=val Fill the gaps between sections with the byte value specified by the argument val. --no-adjust-warnings | --no-change-warnings Do not issue a warning if the section specified by the options --change-section-address, --change-section-lma or --change-section-vma is missing in the input object. --only-keep-debug Copy only debugging information to the output file. --pad-to=address Pad the load memory address of the output object to the value specified by the argument address by increasing the size of the section with the highest load memory address. --prefix-alloc-sections=string Prefix the section names of all the allocated sections with string. --prefix-sections=string Prefix the section names of all the sections with string. --prefix-symbols=string Prefix the symbol names of all the symbols with string. --rename-section oldname=newname[,flags] Rename the section named by argument oldname to newname, optionally changing the sections flags to that specified by argument flags. Allowed values for the argument flags are as for option --set-section-flags below. --set-section-flags sectionname=flags Set the flags for the section named by argument sectionname to those specified by argument flags. Argument flags is a comma sepa- rated list of the following flag names: alloc The section occupies space in the output file. code The section contains machine instructions. contents This flag is accepted but is ignored. data The section contains writeable data. debug The section holds debugging information. load The section is loadable. noload The section should not be loaded into memory. readonly The section is not writable. rom The section contains ROM'able contents. share This flag is accepted but is ignored. --set-start=address Set the start address of the output ELF object to the value specified by the argument address. --srec-forceS3 Only generate S-records of type ``S3''. This option is only meaningful when the output target is set to ``srec''. --srec-len=val Set the maximum length of an S-record line to val. This option is only meaningful when the output target is set to ``srec''. --strip-unneeded Do not copy symbols that are not needed for relocation processing. DIAGNOSTICS
The elfcopy utility exits 0 on success, and >0 if an error occurs. SEE ALSO
ar(1), ld(1), mcs(1), strip(1), elf(3), ar(5), elf(5) HISTORY
elfcopy has been implemented by Kai Wang <kaiwang27@users.sourceforge.net>. BSD
October 03, 2011 BSD
All times are GMT -4. The time now is 11:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy