The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > Linux
Google UNIX.COM


Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here!

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1  
Old 01-21-2006
Registered User
 

Join Date: Jan 2006
Posts: 1
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
Reply With Quote
Forum Sponsor
  #2  
Old 01-22-2006
zazzybob's Avatar
Registered Geek
 

Join Date: Dec 2003
Location: Melbourne, Australia
Posts: 2,100
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
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 11:37 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0