Question on variable inheritance & code statements
1) I have the below code in concattxnrecords.sh shell script and it is calling the genericVars.sh shell script which is mentioned as below has some code inside it which would intialize some variables in it, now my question is will this shell script would inherit those variable definitions or not though it is commented out? I just got confused with my understanding on "#!/bin/ksh" & "#. $HOME/bin/scripts/generic/genericVars.sh"
concattxnrecords.sh
genericVars.sh
2) May i know what is the below code doing, specifically i didn't understand the "if [[ ! -z $MKT_VALUE_FLD ]]" and "shift;" statements in the below code
3) May i also know what are the below statements are doing
Many Thanks,
Regards,
Ariean
1) the values of variables defines in $HOME/bin/scripts/generic/genericVars.sh will be available in concattxnrecords.sh
2)
is the same as
3)
The content of the file "$DAC_POST_SCRIPT/DAC_CONTROL_TOTAL.txt" will be placed instead of
, so the final result you will get is :
the content of file $DAC_POST_SCRIPT/DAC_CONTROL_TOTAL.txt joined with string "^999999999999^$COUNTER" altogether stored at the end of the file $OUTPUT_FILE.out
`head -1' will read the 1-st line of the file DAC_TXN_header.out ;
`cut' will extract the 2-nd field of the input line assumed that `^' sign is the field delimiter;
`sed -e 's/txt/flg/'' as far as I know sed will replace the substring `txt' with the substring `flg'
I am using python 3.4. Below is the exception I am getting-
Traceback (most recent call last):
File "./oop.py", line 20, in <module>
y = DerivedClass("Manu")
File "./oop.py", line 15, in __init__
super().__init__(self,value)
TypeError: __init__() takes 2 positional arguments but... (2 Replies)
i would like to search a variable for a pattern, without having make any calls to external tools.
i have a code like this:
COUNTPRO2="gine is very bad
vine is pretty good"
case "${COUNTPRO2}" in
*vine*)
factor=${COUNTPRO2}
echo $factor
;;
esac
If the variable contains... (7 Replies)
I have the code below and I want to remove the "go to" statements. Any idea how I can do it?
if (iorder == 0) then
tmincurrent = 1.0e11
if(ireverse == 0 .or. istop /= 1) then
do i = 1, 6
if ((side(i) /= sidelimit(i)) .and. (tminside(i) < tmincurrent)) then
... (1 Reply)
Hi,
In multi-level inheritance:
class A {
public:
void fun() { cout << "A" << endl; }
};
class B : public A {
public:
void fun() { cout << "A" << endl; }
};
class C : public B { };
int main() {
C c;
c.fun(); // Ans: A
} (1 Reply)
Hi Guru's.
I am trying to use to check if $5 is greater than 80 & if not 100, then to print $0 :
awk '{ if ($5>80) && if ($5 != 100) print $0}
But getting error:
>bdf1|sed 's/%//g'|awk '{ if ($5>80) && if ($5 != 100) print $0}'
syntax error The source line is 1.
The error... (6 Replies)
Hello all,
I am writing up an input file and I was hoping I could get some guidance as to how to best consolidate these 2 awk statements for 1 while loop.
Here's my input file
# cat databases.lst
#NOTE: These entries are delimited by tabs "\t"
#oracleSID name/pass
#
db11 ... (2 Replies)
Hello,
I'm a shell scripting noob and new to this forum as well. My question is can nested if statements be done with && and || instead and if it can be done can someone provide an example pls.
Thanks in advance for the help (1 Reply)
I have 2 shell scripts the primary one would load the other one which will have functions defined in it.
Script 1:
. /apps/bin/Script 2
function
if
then
continue...
....
fi
Script 2:
function() (10 Replies)
I want to instert Category:XXXXX into the 2. line
something like this should work, but I have somewhere the wrong sytanx. something with the linebreak goes wrong:
sed "2i\\${n}Category:$cat\n"
Sample:
Titel Blahh Blahh abllk sdhsd sjdhf
Blahh Blah Blahh
Blahh
Should look like... (2 Replies)
Hey Everyone,
Does anyone know how - or if it's even possible - for a child perl script to inherit the variables of a parent perl script? In a shell script, you would use "export" for example. I am running Perl 5.8.
Basically, let's say "perl1.pl" calls "perl2.pl" and I want "perl2.pl" to... (2 Replies)