ksh command substitution not executing block commands
We have a function defined in a ksh script that gets called repeatedly and concurrently by background jobs called from within the same shell script file to run PL/SQL commands against an Oracle database. The function is below:
This works 99% of the time, but every once in a while it does not execute the steps within the block:
whenever oserror exit failure whenever sqlerror exit sql.sqlcode set heading off set recsep off set feedback off set pagesize 0 set linesize 100 set trimspool on set serverout on size 1000000 exec ${procName} quit
Using set -x in the script reveals the following output on the 1% occasion:
+ sqlplus -s /
+ 0<< \_EOF_
_EOF_
So, it shows that none of the hard coded commands between the first line and the last line of the block are sent to sqlplus.
In the 99% case, the following is the output from set -x
+ sqlplus -s /
+ 0<< \_EOF_
whenever oserror exit failure
whenever sqlerror exit sql.sqlcode
set heading off
set recsep off
set feedback off
set pagesize 0
set linesize 100
set trimspool on
set serverout on size 1000000
<plsql call was here>
quit
_EOF_
Has anyone ever seen this behavior before? We are running Red Hat Enterprise Linux Server release 5.3 (Tikanga)
It is a non-root user and it is not really recursion as it is not calling itself. The runPLSQL function is being called by another function (function1 for example) in a loop lower in the same script file in the background.
That loop keeps up to 50 calls to function1 running concurrently using background tasks and function1 calls runPLSQL 3 times for each execution.
Time to look at the maximum number of processes allowed by a non-root user in your kernel. You appear to be describing these symptoms but have evaded the question.
Maybe try:
and compare with the kernel configuration for the maximum number of processes allowed per user.
I have a script that has quite a lot of these types of entries:
hello=$(who am i)
good=$(blahblah)
what i want to do is replace the $( and the ) with `` so that they look like this:
hello=`who am i`
good=`blahblah`
I tried this:
:%s~=$(&&)$~=`&&`$~g (3 Replies)
I'm trying to do an ls from inside of a ksh script. I loop through the results one line at a time and attempt to do a substitution using sed to convert YYYYMMDD from the older files into the newer files. Basically sometimes the ETL load runs over midnight and half the files are off by one day... (3 Replies)
Dear Friends,
Please let me know how to use the date command inside the substitution flag replacement string.
echo "01 Jan 2003:11:00:06 +0100" | sed 's/\(.*\)/`date -d \1 "+%Y%m%d%H%M%S"`/'
I want to supply \1 string to Here mention below as part of replacement string,
date -d <Here>... (5 Replies)
Hello,
In bash I can use the following:
TMP=12345
MID=${TMP:1:1}
the expected result is: 2
but when using KSH I'm getting a ''bad substitution" error.
What is the correct syntaxin ksh?
Thanks (2 Replies)
hi,
i created a shell script having the following content:
#! /usr/bin/ksh
FROM="myemail@domain.com"
MAILTO="someemail@domain"
SUBJECT="TEST"
BODY="/export/home/adshocker/body.txt"
ATTACH="/export/home/adshocker/attach.prog"
echo $ATTACH
ATTACH_NAME="${ATTACH##*/}"
echo $ATTACH_NAME... (5 Replies)
Hi
I have a variable BIT1 which holds some value. Is there a way to retrieve the value of this variable indirectly via another variable, lets say SUBSET_BIT_NUM=1, so the call will look something like this:
sundev1 $ echo ${BIT${SUBSET_BIT_NUM}}
ksh: ${BIT${SUBSET_BIT_NUM}}: bad substitution
... (3 Replies)
Hi,
Following code is working in bash but not in ksh.
Can someone please send me an alternative?
#!/bin/ksh
fname="EOA.dmp"
echo $fname
logname=${fname/.dmp/.log}
echo $logname
I am getting below error in ksh
"testcmd: logname=${fname/.dmp/.log}: 0403-011 The specified substitution... (3 Replies)
Following code is working in bash but not in ksh.
Can someone please send me an alternative?
#!/bin/ksh
fname="EOA.dmp"
echo $fname
logname=${fname/.dmp/.log}
echo $logname
I am getting below error in ksh
"testcmd: logname=${fname/.dmp/.log}: 0403-011 The specified substitution is not... (2 Replies)
Hi folks
Please let me know if anyone knows how to handle this.
My KSH script -> testscript.ksh
cmd=$1
ENV="devl"
echo $cmd
This is how I call the script
./testscript.ksh 'ps -ef | grep br$ENV'
How do I get this to print the below text i.e $ENV should be substituted with the value... (5 Replies)
Hello,
I thought it was possible to use several time a #! entry on a script but it doesn't seems to work. My need is to have a part of a ksh script without substitution so it would look like
#!/bin/ksh
--
first part
---
#!/bin/ksh -f
--
part without substitution
--
#!/bin/ksh
--... (2 Replies)