10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi Gurus,
I have a script which send sql query to oracle db and return value to my script.
dummy code like below:
sqlplus -s user/${PASSWD}@${ORACLE_SID} @${DIR}/query.sql > outputfile
using above code, when query has error, it send error to same out put file and exit code is 0, is... (6 Replies)
Discussion started by: ken6503
6 Replies
2. Shell Programming and Scripting
The code at the bottom is a simplified example of what we have.
If I use the following:
&& echo "echo failed"
$? returns 1
When I use
if ; then echo "echo failed" ; fi
$? returns 0
Does anyone know what's wrong with this?
Using AIX 6.1 and KSH
for NUM in 1 2 3
do
... (5 Replies)
Discussion started by: jfxdavies
5 Replies
3. Shell Programming and Scripting
Hi,
I'm a rookie who is trying to learn this stuff. What I need help with is putting together a non complicated "while" loop within the below "if" statement. I also need the while loop to keep looping until the user types a key to end the loop. Please reveal the proper insertion points. Thank... (4 Replies)
Discussion started by: jefferj54
4 Replies
4. Shell Programming and Scripting
Hi Experts,
Problem summary :
I am facing the below problem on huge files when the disk is getting full on the half way through the execution.
If the disk was already full , the commands fail & everything is fine.
Sample Code :
head_rec_data_file=`head -1 sample_file.txt`
cat... (9 Replies)
Discussion started by: Pruthviraj_shiv
9 Replies
5. Shell Programming and Scripting
I have a Python script that updates an rrd file with data it pulls from a database. Here is a snippet of the Python code
for i in range(numrowed):
row = curred.fetchone()
time_stamp = row
rx_max = row
ret =... (1 Reply)
Discussion started by: kaf3773
1 Replies
6. Shell Programming and Scripting
Hi
I've gotten a plugin script that won't run. I keeps throwing an error at the following line.
for BARCODE_LINE in `cat ${TSP_FILEPATH_BARCODE_TXT} | grep "^barcode"`
do
#something
done
The error reads
... (3 Replies)
Discussion started by: jdilts
3 Replies
7. Shell Programming and Scripting
We have script running to SFTP some file to the remote server. The problem is the SFTP transfer returns an exit code of 0 even if there is permission error during file transfer, connection refuse (like when sftp server is down), thus, returning the status of the script as success.
I was thinking... (3 Replies)
Discussion started by: The One
3 Replies
8. Programming
I have some unstable mistake in my program and out-of-idea how to catch it.
I am looking for advice with a way to work it out!
I have in a pretty complicated program (but one source file) set of int-counters - 15, if exactly.
Lately, on final printout I have inpossible value (I am... (3 Replies)
Discussion started by: alex_5161
3 Replies
9. Shell Programming and Scripting
I have a weird situation in which the binary dumps core and gives bus error. But before dumping the core and throwing the buss error, it gives some output.
unfortunately I can't grep the output before core dump
db2bfd -b test.bnd
maxSect 15
Bus Error (core dumped)
But if I do ... (4 Replies)
Discussion started by: rakeshou
4 Replies
10. UNIX for Dummies Questions & Answers
#!/usr/bin/ksh
echo Please enter
while read n
do
echo $n >> datafile
done
question:
How can I enject an if statement that if the users enter 0 (zero) the program will exit?
this is what I have but not working
#!/usr/bin/ksh
echo Please enter number
while read n
do
if $n=0
then... (2 Replies)
Discussion started by: bobo
2 Replies