I want to pass an array in my function, And my function will be changing the elements of the array in the fuction, but it should not affect the values in my array variable of main function (1 Reply)
Hi,
I have a master BASH shell script where I define a bunch of variables:
$var1=why
$var2=is
$var3=(this so hard)
I would then like to call another shell script and pass these variables to it:
$script2 $var1 $var2 $var3
This works fine for var1 and var2. However, var3 is an array,... (9 Replies)
Hi experts,
I am here again with another Issue.
I need to pass the array as parameter / argument to another script.
I tried it as follows . ( I got this idea from the link )
$ cat test1.sh
#! /usr/bin/ksh
set -a arr1
echo "...In Test1...."
arr1="APPS_DEV"
arr1="TEST_DEV"
echo... (16 Replies)
Hi,
I have an output generated from a shell script like;
0x41,0xF2,0x59,0xDD,0x86,0xD3,0xEF,0x61,0xF2
How can I pass this value to the C function, as below;
int main(int argc, char *argv) {
unsigned char hellopdu={above value};
}
Regards
Elthox (1 Reply)
Hi
I want to write a script which store all the parameters passed to the script into an array.
Once it is stored I want scan through the array and and delete those files for last month present inside the directory. The files in directory is appneded with YYYY_MM_DD.
I want to know how can I... (3 Replies)
hi,
I have a array say
SAP_ARRAY="s1.txt"
SAP_ARRAY="s2.txt"
how can i pass this full array to a function.
here is the sample code i am using..
CHECK_NO_FILES()
{
FARRAY=$1
echo "FARRAY = $FARRAY"
echo "FARRAY = $FARRAY"
............... (5 Replies)
Hi, guys
I just wanted to sort the elements of an array ascendingly.
I know the following code does work well:
array=(13 435 8 23 100)
for i in {0..4}
do
j=$((i+1))
while ]
do
if } -le ${array} ]]
then :
else
min=${array}
${array}=${array}
${array}=$min
fi... (5 Replies)
There are two parts to this. In the first part I need to read a list of files from a directory and split it into 4 arrays. I have done that with the following code,
# collect list of file names
STATS_INPUT_FILENAMES=($(ls './'$SET'/'$FOLD'/'*'in.txt'))
# get number of files... (8 Replies)
Hi,
I am creating filesystem for block device, but I want to pass array value one by one acording to block device count.
$tmp1 = block device count 3
$blockdevice =
So I want to first pass sdb1 alone in loop, how to take only block device seprately from $blockdevice array. (1 Reply)
I'm able to read & print an array in varaible called "filelist"
I need to pass this array variable to a function called verify() and then read and loop through the passed array inside the function.
Unfortunately it does not print the entire array from inside the funstion's loop.
#/bin/ksh... (5 Replies)
Discussion started by: mohtashims
5 Replies
LEARN ABOUT LINUX
config
config(5) Files config(5)NAME
config - Configuration file.
DESCRIPTION
A configuration file contains values for configuration parameters for the applications in the system. The erl command line argument -config
Name tells the system to use data in the system configuration file Name.config .
Configuration parameter values in the configuration file will override the values in the application resource files (see app(5) ). The val-
ues in the configuration file can be overridden by command line flags (see erl(1) ).
The value of a configuration parameter is retrieved by calling application:get_env/1,2 .
FILE SYNTAX
The configuration file should be called Name.config where Name is an arbitrary name.
The .config file contains one single Erlang term. The file has the following syntax:
[{Application1, [{Par11, Val11}, ..]},
..
{ApplicationN, [{ParN1, ValN1}, ..]}].
* Application = atom() is the name of the application.
* Par = atom() is the name of a configuration parameter.
* Val = term() is the value of a configuration parameter.
SYS.CONFIG
When starting Erlang in embedded mode, it is assumed that exactly one system configuration file is used, named sys.config . This file
should be located in $ROOT/releases/Vsn , where $ROOT is the Erlang/OTP root installation directory and Vsn is the release version.
Release handling relies on this assumption. When installing a new release version, the new sys.config is read and used to update the appli-
cation configurations.
This means that specifying another, or additional, .config files would lead to inconsistent update of application configurations. There-
fore, in Erlang 5.4/OTP R10B, the syntax of sys.config was extended to allow pointing out other .config files:
[{Application, [{Par, Val}]} | File].
* File = string() is the name of another .config file. The extension .config may be omitted. It is recommended to use absolute paths. A
relative path is relative the current working directory of the emulator.
When traversing the contents of sys.config and a filename is encountered, its contents are read and merged with the result so far. When an
application configuration tuple {Application, Env} is found, it is merged with the result so far. Merging means that new parameters are
added and existing parameter values overwritten. Example:
sys.config:
[{myapp,[{par1,val1},{par2,val2}]},
"/home/user/myconfig"].
myconfig.config:
[{myapp,[{par2,val3},{par3,val4}]}].
This will yield the following environment for myapp :
[{par1,val1},{par2,val3},{par3,val4}]
The behaviour if a file specified in sys.config does not exist or is erroneous in some other way, is backwards compatible. Starting the
runtime system will fail. Installing a new release version will not fail, but an error message is given and the erroneous file is ignored.
SEE ALSO app(5) , erl(1) , OTP Design Principles
Ericsson AB kernel 2.14.3 config(5)