I would like to know the explaination.


 
Thread Tools Search this Thread
Operating Systems Linux I would like to know the explaination.
# 1  
Old 01-21-2006
I would like to know the explaination.

Hi, I'm new to LINUX Scripting, I would like to know the full explaination of the below scripts.
thank you.


1st script
#! /bin/sh
. /opt/home/hssadmin/cindy/formatxml.env

`testrecord.scp`
`testEXGU.scp`




2nd Script
#! /bin/sh
. /opt/home/hssadmin/cindy/formatxml.env

cd $base_directory

for file in `ls -1




3rd Script
#! /bin/sh
. /opt/home/hssadmin/cindy/formatxml.env

cd $base_directory
for file in `ls -1 HssJMSoutLog.*`; do
`grep "<" $file > $file.rawxml.out`
echo '<XML>' > $file.ALL.tmp
sed -e 's/^.*\(<pregate .*\)$/\1/' -n -e '/<pregate/,/<\/pregate>/ p' $file.rawxml.out >> $file.ALL.tmp
sed -e 's/^.*\(<ARGC-ARGU .*\)$/\1/' -n -e '/<ARGC-ARGU/,/<\/ARGC-ARGU>/ p' $file.rawxml.out >> $file.ALL.tmp
sed -e 's/^.*\(<EXGC-EXGU .*\)$/\1/' -n -e '/<EXGC-EXGU/,/<\/EXGC-EXGU>/ p' $file.rawxml.out >> $file.ALL.tmp
sed -e 's/^.*\(<EXLC-EXLU .*\)$/\1/' -n -e '/<EXLC-EXLU/,/<\/EXLC-EXLU>/ p' $file.rawxml.out >> $file.ALL.tmp
sed -e 's/^.*\(<ARLC-ARLU .*\)$/\1/' -n -e '/<ARLC-ARLU/,/<\/ARLC-ARLU>/ p' $file.rawxml.out >> $file.ALL.tmp
sed -e 's/^.*\(<HVEH .*\)$/\1/' -n -e '/<HVEH/,/<\/HVEH>/ p' $file.rawxml.out >> $file.ALL.tmp
sed -e 's/^.*\(<SDEN .*\)$/\1/' -n -e '/<SDEN/,/<\/SDEN>/ p' $file.rawxml.out >> $file.ALL.tmp
echo '</XML>' >> $file.ALL.tmp
sed -e 's/pregate/record/g' -e 's/ARGC-ARGU/record/g' -e 's/EXGC-EXGU/record/g' -e 's/EXLC-EXLU/record/g' -e 's/ARLC-ARLU/record/g' -e 's/HVEH/record/g' -e 's/SDEN/record/g' $file.ALL.tmp> $file.tmp.xml
mv $file.tmp.xml $output
rm $file.rawxml.out
rm $file.ALL.tmp
mv $file $process_folder
done
# 2  
Old 01-22-2006
With the help of this thread you should understand what is happening in script 3 - it looks like the same script...

For the other two questions the manual page for the shell that you're using will explain all.

Cheers
ZB
Login or Register to Ask a Question

Previous Thread | Next Thread

5 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Explaination on export command

Hello Team, Could you pls explain how export command works in below code: for i in ${!SDV_*}; do export $i done As per my understanding, if SDV_1=test1;SDV_2=test2;test1=var1;test2=var2then in for loop below export will get executed. export var1;export var2But, Will this... (3 Replies)
Discussion started by: chandana.hs
3 Replies

2. Shell Programming and Scripting

Explaination on if true

Hi Team, I need to know why ppl use If true loop instead of just writing down the sequence of code lines. 1: echo "Line1" if true; then echo "Line2" fi echo "Line3" 2: echo "Line1" echo "Line2" echo "Line3" Could you explain what does the if true loop make difference in 1st compare... (3 Replies)
Discussion started by: chandana hs
3 Replies

3. Shell Programming and Scripting

Explaination on Behavior of awk command

Hello Admin, Could you pls explain on the below behavior of the awk command. $ awk -F">20" "/Cyclomatic complexity/ && /;add;/{print \$1}" inspect_64d_369980 | awk '{print $NF}' | sort | tail -1 65 $var=`awk -F">20" "/Cyclomatic complexity/ && /;add;/{print \$1}" inspect_64d_369980 | awk... (3 Replies)
Discussion started by: chandana hs
3 Replies

4. Programming

Need explaination for a function please

can anybody explain a long fpathconf(int fildes, int name); what it do like 1- lim = fpathconf(STDIN_FILENO, _PC_NAME_MAX); printf("%s %ld\n", "_PC_NAME_MAX: ", lim); 2- lim = fpathconf(STDIN_FILENO, _PC_PATH_MAX); printf("%s %ld\n", " _PC_PATH_MAX ", lim); 3- lim =... (1 Reply)
Discussion started by: fwrlfo
1 Replies

5. Shell Programming and Scripting

Looking for awk code explaination

{ # print NF,NR,$0; if ( ($(NF-1) != 0) && ($NF != 0) ) {if ($(NF-1) > $NF) {percent=$(NF-1)/$NF-1;} else {percent=$NF/$(NF-1)-1;} } printf "%8.4f\%\n",percent*100; if (percent > 0.05||percent < -0.05 ){exit 1;} }' Use code tags please, ty. Also try to use a more... (1 Reply)
Discussion started by: bosmat shani
1 Replies
Login or Register to Ask a Question