![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Linux RedHat, Ubuntu, SUSE, Fedora, Debian, Mandriva, Slackware, Gentoo linux, PCLinuxOS. All Linux questions here! |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
#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 |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
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 |
||||
| Google The UNIX and Linux Forums |