Sponsored Content
Top Forums Shell Programming and Scripting Creating a config file with specified parameters Post 303025505 by multiverse22 on Sunday 4th of November 2018 01:23:18 PM
Old 11-04-2018
Creating a config file with specified parameters

I want to create a config file that has parameters that can be specified using - or -- (without an equals sign), as well as the ability to output the file using - or --. Could somebody point me to a generic script to do this? Say for example, I wanted to run MainScript and have it set alpha to 2 and beta to 3 in config.cfg by saying

MainScript --alpha 2 --beta 3 --output config.cfg

and have it also work by saying

MainScript -a 2 -b 3 -o config.cfg

So then if I open config.cfg it has

alpha = 2
beta = 3

The input values for alpha and beta can be any positive integer, and these are just arbitrary names. I want to be able to eventually set default values for alpha and beta, as well.

Thanks!

Last edited by multiverse22; 11-04-2018 at 03:43 PM..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting data from text file based on configuration set in config file

Hi , a:) i have configuration file with pattren <Range start no>,<Range end no>,<type of records to be extracted from the data file>,<name of the file to store output> eg: myfile.confg 9899000000,9899999999,DATA,b.dat 9899000000,9899999999,SMS,a.dat b:) Stucture of my data file is... (3 Replies)
Discussion started by: suparnbector
3 Replies

2. Shell Programming and Scripting

Generate PARAMETERS from config file

Hi, I have a config file like below: config.cfg ========== PARAm_1_MIN=20 PARAM_1_MAX=40 PARAM_2_MIN=3 PARAM_2_MAX=40 PARAM_3_MIN=0 PARAM_3_MAX=4.5 ..... ... ... (1 Reply)
Discussion started by: sachin4sachi
1 Replies

3. AIX

tuning network parameters : parameters not persist after reboot

Hello, On Aix 5.2, we changed the parameters tcp_keepinit, tcp_keepintvl and tcp_keepidle with the no command. tunrestore -R is present in inittab in the directory /etc/tunables we can clearly see the inclusion of parameters during reboot, including the file lastboot.log ... (0 Replies)
Discussion started by: dantares
0 Replies

4. 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

5. 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

6. Shell Programming and Scripting

help with creating a suitable config file

Hi, currently, my shell script hard codes several array variables (etc. PEOPLE=( Vincar Matthew ) FRUITS=( Banana Apple Orange Pineapple ) I want to move these information into one config file and then in my shell script, parse the config file into the appropriate variables. Do... (13 Replies)
Discussion started by: kaoboy97
13 Replies

7. UNIX for Advanced & Expert Users

parameters file

Hi, on AIX 6.1 I have a shell script that calls another shell which have some parameters. Say like the following : ##This is main script############ myparameters.sh command1 command2 ..... .... And here myparameteres.sh : export ORACLE_SID=MYDB export... (6 Replies)
Discussion started by: big123456
6 Replies

8. Shell Programming and Scripting

Run a program-print parameters to output file-replace op file contents with max 4th col

Hi Friends, This is the only solution to my task. So, any help is highly appreciated. I have a file cat input1.bed chr1 100 200 abc chr1 120 300 def chr1 145 226 ghi chr2 567 600 unix Now, I have another file by name input2.bed (This file is a binary file not readable by the... (7 Replies)
Discussion started by: jacobs.smith
7 Replies

9. Red Hat

Apache virtual host config vs global config problem

Hi folks, I am trying to configure Apache webserver and also a virtual host inside this webserver. For Global server config: /var/www/html/index.html For virtual host config: /var/www/virtual/index.html Both client10 & www10 are pointing to 192.168.122.10 IP address. BUT, MY... (1 Reply)
Discussion started by: freebird8z
1 Replies

10. Shell Programming and Scripting

Shell Script to Dynamically Extract file content based on Parameters from a pdf file

Hi Guru's, I am new to shell scripting. I have a unique requirement: The system generates a single pdf(/tmp/ABC.pdf) file with Invoices for Multiple Customers, the format is something like this: Page1 >> Customer 1 >>Invoice1 + invoice 2 >> Page1 end Page2 >> Customer 2 >>Invoice 3 + Invoice 4... (3 Replies)
Discussion started by: DIps
3 Replies
DLAGTM(l)								 )								 DLAGTM(l)

NAME
DLAGTM - perform a matrix-vector product of the form B := alpha * A * X + beta * B where A is a tridiagonal matrix of order N, B and X are N by NRHS matrices, and alpha and beta are real scalars, each of which may be 0., 1., or -1 SYNOPSIS
SUBROUTINE DLAGTM( TRANS, N, NRHS, ALPHA, DL, D, DU, X, LDX, BETA, B, LDB ) CHARACTER TRANS INTEGER LDB, LDX, N, NRHS DOUBLE PRECISION ALPHA, BETA DOUBLE PRECISION B( LDB, * ), D( * ), DL( * ), DU( * ), X( LDX, * ) PURPOSE
DLAGTM performs a matrix-vector product of the form B := alpha * A * X + beta * B where A is a tridiagonal matrix of order N, B and X are N by NRHS matrices, and alpha and beta are real scalars, each of which may be 0., 1., or -1. ARGUMENTS
TRANS (input) CHARACTER Specifies the operation applied to A. = 'N': No transpose, B := alpha * A * X + beta * B = 'T': Transpose, B := alpha * A'* X + beta * B = 'C': Conjugate transpose = Transpose N (input) INTEGER The order of the matrix A. N >= 0. NRHS (input) INTEGER The number of right hand sides, i.e., the number of columns of the matrices X and B. ALPHA (input) DOUBLE PRECISION The scalar alpha. ALPHA must be 0., 1., or -1.; otherwise, it is assumed to be 0. DL (input) DOUBLE PRECISION array, dimension (N-1) The (n-1) sub-diagonal elements of T. D (input) DOUBLE PRECISION array, dimension (N) The diagonal elements of T. DU (input) DOUBLE PRECISION array, dimension (N-1) The (n-1) super-diagonal elements of T. X (input) DOUBLE PRECISION array, dimension (LDX,NRHS) The N by NRHS matrix X. LDX (input) INTEGER The leading dimension of the array X. LDX >= max(N,1). BETA (input) DOUBLE PRECISION The scalar beta. BETA must be 0., 1., or -1.; otherwise, it is assumed to be 1. B (input/output) DOUBLE PRECISION array, dimension (LDB,NRHS) On entry, the N by NRHS matrix B. On exit, B is overwritten by the matrix expression B := alpha * A * X + beta * B. LDB (input) INTEGER The leading dimension of the array B. LDB >= max(N,1). LAPACK version 3.0 15 June 2000 DLAGTM(l)
All times are GMT -4. The time now is 07:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy