help required in understanding this script!!!


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting help required in understanding this script!!!
# 1  
Old 05-20-2009
Error help required in understanding this script!!!

Hi Everyone,

Please find below the script, I needed to understand step by stepSmilie. Please If someone can help me out i will be very greatfulSmilie.

Please Guide me in a way which can help me out in figuring what this script doing on my server.


========================================================
#!/bin/sh
time=`date +%Y%m%d-%H%M%S`
echo $time":: process of modification started..."
while read abcd
do
dbaccess xyzdb << EOF >> db$abcd.log 2>&1
alter table $abcd add ( encrypt char(11) ) ;
create index idx_neuker on $abcd(insys_serial) ;
update statistics high for table $abcd(insys_serial);
create procedure p$abcd()
returning char(40);
DEFINE acc_num char(20);
DEFINE i integer;
DEFINE sum integer;
set debug file to 'pev_rech_yyyymmnn.log';
trace 'begin update';
let i = 0;
let sum=0;
begin work;
foreach up_cur with hold for
select insys_serial into acc_num from $abcd
update $abcd set encrypt=msisdn where insys_serial=acc_num;
let i=i+1;
let sum=sum+1;
if i=10000 then
trace 'record processed '||sum;
commit work;
let i=0;
begin work;
end if
end foreach
commit work;
trace 'procedure ok! total processed records are '||sum;
return "procedure complete!";
end procedure;
execute procedure p$abcd();
drop procedure p$abcd ;
drop index idx_neuker;
EOF
time=`date +%Y%m%d-%H%M%S`
echo $time":: "$abcd" table is modified."
done < ab_done_yyyymm_tablenames.unl
=========================================================
# 2  
Old 05-20-2009
duplicate posts are not allowed read the forum rules!!!


Thread closed!!!


---vidya
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Understanding a script for sum

Hello, How come the following script adds each numeric value to a total sum ? x=$1 func() { for i in $1 $2 $3; do let x= $x+$i done } func "8 8 8" 9 9 echo $x A.How the program sums the string "8 8 8" if it`s only the first field value ($1)? B.If we define x to be $1... (3 Replies)
Discussion started by: uniran
3 Replies

2. UNIX for Beginners Questions & Answers

Shall script use and understanding

Below script is called as Reducer, I am not sure how it work, can some expert explain me what this script does as i am a beginner. inputfile: hi hi how are are you code: #!/bin/bash lastkey=""; -- what does this mean, because i saw in debug mode it is taking value as hi count=0;... (13 Replies)
Discussion started by: mirwasim
13 Replies

3. Shell Programming and Scripting

Help understanding the script

Could someone please help me in understanding the code below: #!/usr/bin/ksh Month=`date|cut -c5-7` Day=`date|cut -c9-10` Year=`date|cut -c27-28` Rom2Jul() { case $Month in Feb) Day=$(( $Day+31 ));; Mar) Day=$((... (27 Replies)
Discussion started by: hasn318
27 Replies

4. Shell Programming and Scripting

Help--understanding the script

Hi, New to this forum, as well as to unix scripting..need help to understand below script ... sendNotice_sp() { ATTACH=${LNXLOG:-} if ; then if ; then mail -s "$ERR_MSG" $ERR_EMAIL_TO < $ATTACH fi else mail -s "$ERR_MSG" $ERR_EMAIL_TO < /dev/null fi } afaik this is sm kind of... (6 Replies)
Discussion started by: gnnsprapa
6 Replies

5. Shell Programming and Scripting

help on understanding this script ( linux)

ORACLE_HOME=/opt/ora10g/oracle/product/10.2.0/db_1;export ORACLE_HOME PATH=.:$ORACLE_HOME/bin:/usr/bin;export PATH ORACLE_SID=USUP PASS=Figomom#0;export PASS rm /orabkup/USUP/*.Z if ] then echo $PASS | sqlplus system@USUP @/home/ora10g/crons/scripts/hot.sql echo $PASS | sqlplus... (5 Replies)
Discussion started by: redologger
5 Replies

6. Shell Programming and Scripting

Help understanding the script

Hi Guys, I am new to scripting , I am trying to rebuild a script based on an old script. Can someone help me figure out what the script is doing? This is only a part of the script. I am looking to interpret these two points in the scripts:- 1) test=`echo $?` while I do not... (3 Replies)
Discussion started by: rajsan
3 Replies

7. UNIX for Dummies Questions & Answers

help with understanding script

i am trying to understand this script example. the text does not explain it. can someone tell me briefly what each of the functions do. any help will be appreciated. #!/bin/bash killtree() { local _pid=$1 local _sig=${2-TERM} for _child in $(ps -o pid --no-headers --ppid... (1 Reply)
Discussion started by: iluvsushi
1 Replies

8. Shell Programming and Scripting

Need help understanding this script.

Can someone explain what is happening line by line in this script, particularly after the do statement. The script works, it renames all the files in my directory that has a date in the file name. But I would like to know more about it. #!/bin/bash newdate=12-10-1995 for file in *--* do ... (6 Replies)
Discussion started by: Harleyrci
6 Replies

9. Shell Programming and Scripting

Need help for understanding of script

# sub: find block (in cols), return line-numbers (begin-end) or 0 if notfound sub findb{ my ($exp1,$col1,$exp2,$col2)= @_; # $exp = expression to find, $col - column to search in my $cnt=0; my ($val1,$val2); my ($beg,$end); for($cnt=1;$cnt<=65536;$cnt++){ $val1 =... (3 Replies)
Discussion started by: suvenduperl
3 Replies

10. Shell Programming and Scripting

Help understanding a script

Hello everybody, Can anybody tell me of what "~" refers to in the below code snippet. lsvg $vgNAME | awk 'BEGIN {freeDISK=1} {if (($4 ~ /PP/ && $5 ~ /SIZE/) || ($4 ~ /FREE/ && $5 ~ /PPs/)) {freeDISK *= $6 }} END {print freeDISK*1024 }' Thanks in advance, (6 Replies)
Discussion started by: tenderfoot
6 Replies
Login or Register to Ask a Question