The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
trouble executing and running on BSD from DG Gerry405 BSD 6 12-10-2005 09:02 PM
Trouble using substr function with Bourne shell script E2004 Shell Programming and Scripting 4 09-29-2005 11:57 AM
Running a script. vcardo10 UNIX for Dummies Questions & Answers 2 12-29-2003 07:31 AM
trouble with script whegra Shell Programming and Scripting 4 10-17-2002 02:48 PM
running a script? jtredway UNIX for Dummies Questions & Answers 2 09-12-2001 12:08 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 05-12-2008
cahyo3074 cahyo3074 is offline
Registered User
  
 

Join Date: May 2008
Posts: 5
Smile trouble in running script

HI admin unix,

I'm from indonesia that currently work as system admin for server under AIX/UNIX environment.

I have some trouble when running script as follow :

##
vdate()
{
sqlplus -s ${MMUSER}/${PASSWORD} <<-eot|grep -v '^$'
set heading off feedback off
select to_char(vdate,'YYYYMMDD') from period;
eot
}

cek1()
{
sqlplus -s ${MMUSER}/${PASSWORD}@${ORACLE_SID}<<-eot|grep -v '^$'
set heading off feedback off echo off
SELECT count(1)
FROM item_loc a
LEFT OUTER JOIN
item_supp_country b ON a.item = b.item
AND a.primary_supp =b.supplier
WHERE a.item_parent IS NOT NULL
AND loc = (SELECT like_store
FROM store_add)
AND supp_pack_size IS NULL
AND primary_supp IS NOT NULL;
eot
}

cek2()
{
sqlplus -s ${MMUSER}/${PASSWORD}@${ORACLE_SID}<<-eot|grep -v '^$'
set heading off feedback off echo off
SELECT TRIM (COUNT (1))
FROM (SELECT DISTINCT item
FROM item_loc il
WHERE loc IN (SELECT like_store
FROM store_add) AND item_parent IS NOT NULL
MINUS
SELECT DISTINCT item
FROM vat_item vat);
eot
}

CplkStore()
}
sqlplus -s ${MMUSER}/${PASSWORD}@${ORACLE_SID}<<-eot|grep -v '^$'
set heading off feedback off echo off

SELECT store||'-'||like_store
FROM store_add;
eot
)

recCplkStore=`CplkStore`
recCek1=`cek1`
recCek2=`cek2`

textCplkStore="`date '+%h %d %r'`: Copy Like Store: "
textCek1="`date '+%h %d %r'`: Data Item/Loc Supplier belum lengkap : ${recCek1}"
textCek2="`date '+%h %d %r'`: Data Item VAT belum lengkap: ${recCek2}"

echo "Copy like Store: `echo ${recCplkStore}|awk -F '-' '{print $1}'` from store `echo ${recCplkStore}|awk -F '-' '{print $2}'`"
echo "testing"
if [ "${recAfter}" != "0" ]
then
echo "There are some errors found in MPP_STG_MSM20_PSH table!"
exit 1
else
echo "MSM20 finished successfully."
exit 0
fi

the result is :
"Segmentation Fault (core dump)"

i already unlimited coredumpsize, memory size but error is still remain :
"Segmentation fault"
(coredump is already gone)

Can anyone help me for that ?

Thanks.

Cahyo
 

Bookmarks

Tags
awk, awk trim, trim, trim awk

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:50 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0