trouble in running script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting trouble in running script
# 1  
Old 05-12-2008
Bug 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
# 2  
Old 05-12-2008
A segmentation fault is usually caused by a bug in a programme, where it attempts to access memory which it does not own.

Do you know at what stage in your script it is failing? Try adding set -x to the beginning of the script so you can trace it.
# 3  
Old 05-21-2008
Please don't send private messages, otherwise the other members can not benefit from your experience.

Quote:
Originally Posted by cahyo3074
i already add set -x to the beginning of the script but there are no effect ?
What step actually that i must do ? thx

FYI - i use IBM p570 AIX 5.3
Where exactly did you add it? It should display each line of the script as it is executed. What shell are you running it under? Is there no "shebang line" at the beginning of the script, e.g. #!/usr/bin/ksh?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Having trouble with My Bash Script, need Help debugging

Hello Friends I am having trouble with my script below. I will describe the problems below the code box. I am hoping that some of the experts here can help me. #!/bin/bash #========================================================================================================= # Rsync File... (8 Replies)
Discussion started by: jdavis_33
8 Replies

2. Shell Programming and Scripting

I am having trouble with this count script

I have to display the file name followed by the line count then work count. I am able to display it in the opposite order, but can figure out how to switch it. Can anyone help me with this it would be greatly appreciated. My code is as follows: #!/bin/bash # #Conts and displays the... (5 Replies)
Discussion started by: football12345
5 Replies

3. Shell Programming and Scripting

trouble looping in script

I am having problem looping this script I want to give the user option to decide if they want to continue after each entry but then also loop it back to beginning so they can more to content of there testcase they just created. I fam new to scripting so loops are little tricky for me. code I... (7 Replies)
Discussion started by: andrew.p.mcderm
7 Replies

4. Shell Programming and Scripting

find and copy script trouble

Hi guys First thing to say is that I am entirely new to Shell Scripting and am trying to write a script to do something I thought would be relatively simple, but has escaped me. Essentially, I want to take file name information from a list, find the files listed and then copy the results into... (0 Replies)
Discussion started by: acheron
0 Replies

5. UNIX for Dummies Questions & Answers

trouble with snmpwalk script

I am using a line of code that I borrowed from someone else's script, in a script to monitor changes in my local network. It works but it takes too long to pick up the changes. snmpwalk -v 2c -c PASSWORD -Oq 10.0.1.1 RFC1213-MIB::atPhysAddress The snmp server is my apple router. If I monitor... (7 Replies)
Discussion started by: chancho
7 Replies

6. Homework & Coursework Questions

unix script trouble

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Hi I am new to unix and need some help, the main reason I am here is because i need basic unix knowledge The... (2 Replies)
Discussion started by: krolike
2 Replies

7. Shell Programming and Scripting

Trouble With Script When Using a timerange in AM that spans into PM

I have a script where a user provides a date, start time and end time. The script will take these values and scan a log file to search for key words in the log file that fall within the time range. When a user uses AM times (Example: 700 to 900 - this is 7am to 9am) as a range or PM times... (7 Replies)
Discussion started by: biddieboy
7 Replies

8. Shell Programming and Scripting

trouble making a useradd script

i'm new to scripting in unix and am trying to make a script to add a user and an encrypted password for them. this is what i have and it isn't giving me any errors, but when i try to login with the new user, the password doesn't work. i'm hoping someone can point me in the right direction ... (1 Reply)
Discussion started by: patt4179
1 Replies

9. BSD

trouble executing and running on BSD from DG

Hi, I recently installed FreeBSD 6.0, and am now trying to run my newly created sh scripts, that I ftp'd over from my works Data General - Unix server, I thought they would at least sumwhat/part run, but I can'y even get my basic menu to run and don't know why, can anyone help me by throwing... (6 Replies)
Discussion started by: Gerry405
6 Replies

10. Shell Programming and Scripting

trouble with script

I'm having a little trouble finishing up this script any help would be great. My system is SCO OpenServer Enterprise System (ver 5.0.5m) and i'm using sh This script checks todays date and goes and downloads a file with yesterdays date in the name. ---start---- Server="ipaddresshere"... (4 Replies)
Discussion started by: whegra
4 Replies
Login or Register to Ask a Question